Closed ekirchman closed 8 months ago
I recently came across a Python script by lvgl for converting images: https://github.com/lvgl/lvgl/blob/master/scripts/LVGLImage.py. Could you see if it works with that?
python3 LVGLImage.py --ofmt BIN --cf TRUECOLOR_ALPHA ~/Documents/projects/pinetime/ref/FEPT_imgs/Enemy.png
It seemed to work when I made the output format TRUECOLOR_ALPHA.
But it looks like the preferred binary format output for inifiniTime is ARGB8565_RBSWAP. I don't know what binary format this script outputs.
(Uploading the bin file as a zip since Github won't let me upload it as a .bin
)
Enemy.bin.zip
Tagging @NeroBurner
Verification
Introduce the issue
Pillow supports a lot of different modes as seen here 'P' mode is an 8-bit pixel mode that not only is space efficient but also supports color and transparency. When trying save an an external resource using
CF_TRUE_COLOR_ALPHA
, the errorTypeError: 'int' object is not subscriptable
is printed because this mode does not have "channels".Steps to reproduce:
A workaround for now is to use Pillow to convert the mode from 'P' to 'RGBA', but this increases the file size.
Full traceback:
Preferred solution
Add a condition to check the mode before doing the conversion and handle accordingly
Version
No response