-
-
Notifications
You must be signed in to change notification settings - Fork 959
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: support other modes like 'P' #1989
Conversation
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
@ekirchman please review |
Build size and comparison to main:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Is there any reason we don't want to use try and handle each mode separately? GIMP and Gwenview can even can tell that these images have transparency to them. And at least before they're converted to RGBA, 'P' type images are smaller in file size than RGBA images |
InfiniTime/src/resources/lv_img_conv.py Line 141 in 84e9425
Other than that I don't really know why we "only" have You may look at the original javascript based My guess is, that any binary format this script can produce is in some way usable by LVGL. Maybe only a subset of those are usable by PineTime, but I honestly don't know In any case, I hope your original issue is resolved with this. If so please approve the PR :) |
The output is controlled entirely by the color_format and binary_format options, so converting the input shouldn't have any effect on the output. This means that you don't need to be concerned about the file size being bigger with the "RGBA" mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @FintasticMan that due to the color format being the same the file size shouldn't different if at all
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