-
-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lv_img_conv.py doesn't handle 8-bit pixel mode #1985
Comments
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? |
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 |
Tagging @NeroBurner |
Support other image modes like `P`, which uses 8 bits per pixel and a color palette to save space. Luckily the Pillow module can do the mode conversion for us. Fixes: #1985
Support other image modes like `P`, which uses 8 bits per pixel and a color palette to save space. Luckily the Pillow module can do the mode conversion for us. Fixes: #1985
Support other image modes like `P`, which uses 8 bits per pixel and a color palette to save space. Luckily the Pillow module can do the mode conversion for us. Fixes: InfiniTimeOrg#1985
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
The text was updated successfully, but these errors were encountered: