Python script to convert any type of image to C header array of bytes for EPaper display in multiple bit per pixel mode.
HD EPaper display with small microcontroller uses a lot of memory. Some displays can be used with less than 1 byte per pixel. In this case images cost less memory. This script converts any image to C header array of bytes for EPaper display in multiple bit per pixel mode (1, 2, 4 or 8 bits). It can be used with IT8951 library.
- The
convert
command is not available on Windows. You have to install ImageMagick - Any version of Python 3.x
- Pillow
pip install Pillow
python img2array.py TYPE IMG_WIDTH IMG_HEIGHT IMG1_FILE_PATH IMG2_FILE_PATH ...
TYPE
can be1bpp
,2bpp
,4bpp
or8bpp
IMG_WIDTH
andIMG_HEIGHT
are the width and height of the output image in pixelsIMGX_FILE_PATH
are the paths to the image files. Batch processing is supported.
👤 Le French POC
- Github: @LeFrenchPOC
- Website: https://www.lefrenchpoc.fr/
Give a ⭐️ if this project helped you!
Copyright © 2021 Le French POC.
This project is MIT licensed.