Skip to content

Python script to convert any type of image to C header array of bytes for EPaper display in multiple bit per pixel mode.

License

Notifications You must be signed in to change notification settings

LeFrenchPOC/xbpp-img2array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Welcome to xbpp-img2array 👋

License: MIT

Python script to convert any type of image to C header array of bytes for EPaper display in multiple bit per pixel mode.

What is it?

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.

Dependencies

  • The convert command is not available on Windows. You have to install ImageMagick
  • Any version of Python 3.x
  • Pillow
pip install Pillow

Usage

python img2array.py TYPE IMG_WIDTH IMG_HEIGHT IMG1_FILE_PATH IMG2_FILE_PATH ...
  • TYPE can be 1bpp, 2bpp, 4bpp or 8bpp
  • IMG_WIDTH and IMG_HEIGHT are the width and height of the output image in pixels
  • IMGX_FILE_PATH are the paths to the image files. Batch processing is supported.

Author

👤 Le French POC

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Le French POC.
This project is MIT licensed.

About

Python script to convert any type of image to C header array of bytes for EPaper display in multiple bit per pixel mode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages