MicroPython: ESP32 Cheap Yellow Display Board – CYD (ESP32-2432S028R)
With reference to your tutorial on the above I’m having difficulty in using the img2rgb565.py tool which references several imports which are not available to micropython. Is there an app you can give me to develop a RAW image that will be accepted by your given software.
Hello Michael,
The img2rgb565.py file must run directly with Python on your computer (not with MicroPython). So, open the Python file on your compute and run the script to get the raw file.
Regards,
Rui
Hi Rui
Thanks for the prompt response, however
when I run python
the : import PIL
. causes this error:
Traceback (most recent call last):
ImportError: No module named PIL
Looking into the reason it appears that
the Python Imaging Library (PIL), is no longer maintained
Any suggestions?
Mike
If it’s not installed, you need to install the PIL (pillow) python package:
pip install pillow
You can also watch this video on how to install PIL: https://www.youtube.com/watch?v=5V_MxQ6HjpY
Thanks Rui
That works.
One final question on the same subject. Do the image files that are to be converted need to be a specific size i.e in pixel dimensions such as 128×128
Mike
If I remember correctly, you must use an image with the final dimensions that you want but there’s no specific size required. It can be 100×200… or 300×150, it’s up to you.
Example: if you want a 200×150 pixels image, you must convert one image with those dimensions. Then, in the CYD code you need to passe the 200, 150 as parameters:
def load_image(): display.draw_image('your_image.raw', 0, 0, 200, 150)
Example under the “Loading Image on the Display – Code” section: