displayhatmini-python
displayhatmini-python copied to clipboard
I can't figure out the syntax to display to the display a .jpg via Pillow, its not clear in the backlight example
trafficstars
I would super appreciate the python syntax for displaying a .jpg using Pillow. Perhaps in the backlight example? Something super brief would be awesome. The old ST module used: disp.image(X).
thanks again, beautiful screen.
Snarflakes
Hi @snarflakes, try something like this:
width = DisplayHATMini.WIDTH
height = DisplayHATMini.HEIGHT
buffer = Image.new("RGB", (width, height))
displayhatmini = DisplayHATMini(buffer, backlight_pwm=True)
with Image.open("myFile.jpg") as im:
buffer.paste(
im.resize((width // 2, height // 2)),
(width // 4, height // 4)
)
displayhatmini.display()