Dev-91 / Img_to_RGB565

Image to RGB565 Hex file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image to RGB565

Description

PNG or GIF to RGB565 header file converter

Commit

2024.02.05 - first commit

Test Spec

Python 3.9.18

External Library

rgb565-converter
opencv

Manual

python converter.py --help

-h, --help          show this help message and exit

-i INPUT_FILE,    --input INPUT_FILE
                    Input file to be converted.
-o [OUTPUT_FILE], --output [OUTPUT_FILE]
                    Output file to be converted.
-r RESIZE,        --resize RESIZE
                    Resize image.
-d DELETE_TEMP,   --delete DELETE_TEMP
                    Delete temp image.
-s SWAP,          --swap SWAP 
                    Swap bytes for 16-bit words.
As a first example, if you want to convert gif/dev91.png to a header file while
resizing it at a 30% ratio, and delete the temp image file, run the following

python converter.py -i img/dev91.png -o dev91.h -r 0.3 -d true

As a second example, if you want to convert gif/duck.gif to a header file while
resizing it at a 50% ratio, and delete the temp image file, run the following


python converter.py -i gif/duck.gif -o duck_gif.h -r 0.5 -d true

Dev91 Blog

About

Image to RGB565 Hex file


Languages

Language:C++ 99.2%Language:Python 0.8%