To follow up on this thread, here is a python3 script that turns any 400x240 image into a .raw program for the DM42 (and free42).
It is basically one single class (Img2Hex) - you only need PIL or pillow Python package to use it.
Here's how to use it:
Code: Select all
from img2hex import Img2Hex
hexcode = Img2Hex(filename = 'matterhorn.bmp', label = 'MATT', negative = False)
hexcode.toRawFile('MATT.raw')
You can also add payload into the program, like this:
Code: Select all
# Prepare payload
pl = {
"V1": 1234,
"V2": -3.1415,
"VA": "Hello"
}
hx = Img2Hex(filename = 'matterhorn.bmp', label = 'MATT', negative = False, verbose = False, payload = pl)
(I use payloads while creating charts for the DM42: the payload contains the scale, center coordinates and name of the displayed chart - more on this chart plotting app in another thread soon.)
Enjoy !