moninktor/display.py
2025-08-23 15:08:14 -04:00

18 lines
440 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from lib import epd4in2
import os
#picdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),'pic'
from PIL import Image
epd = epd4in2.EPD()
epd.init()
image = Image.open('./document_ready.bmp')
image = image.convert('L')
epd.display_4Gray(epd.getbuffer_4Gray(image))
epd.sleep()
## version grayscale
#epd.Init_4Gray()
#Himage = Image.open(os.path.join(picdir, 'book_base.bmp'))
#epd.display_4Gray(epd.getbuffer_4Gray(Himage))