lv_img_conv icon indicating copy to clipboard operation
lv_img_conv copied to clipboard

ARGB1555 and ARGB4444 support

Open kisvegabor opened this issue 2 years ago • 18 comments

For 16 bit color depth + Alpha now only the non-standard ARGB8565 format can be used. I think it'd be great to support ARGB1555 and ARGB4444 in LVGL hence GPUs could accelerate the drawing of 16 bit ARGB images too.

So the question is how difficult would it be to add support for these formats in the converter?

If the converter supported them, I could quickly made them work in LVGL.

kisvegabor avatar Apr 26 '22 14:04 kisvegabor

Sure, I think I can add support for these very easily. One thing is unclear: currently the output format is dependent on LV_COLOR_DEPTH, so how do you want these formats to be selected?

embeddedt avatar Apr 27 '22 20:04 embeddedt

@kisvegabor Bump - just wanted to make sure my response wasn't missed.

embeddedt avatar May 04 '22 13:05 embeddedt

Sorry, I had some busy days.

currently the output format is dependent on LV_COLOR_DEPTH, so how do you want these formats to be selected?

Not always. E.g. indexed an alpha only images are exported as they are regardless to LV_COLOR_DEPTH. So I think we can list and handle these formats similarly to indexed and alpha only.

An other format request came up here. It short, in case of ARGB8565 images the pixels has 3 byte size which odd and slow to read. Instead we can have a special format for this where RGB565 pixels are written normally, and A8 pixels are written after them in the same array. We can use the image widdth/heigth to know where the alpha array starts. Can it be added with the other 2 format?

I think these names for the color format could work:

LV_IMG_CF_ARGB4444
LV_IMG_CF_ARGB1555
LV_IMG_CF_RGB565A8

kisvegabor avatar May 04 '22 19:05 kisvegabor

I've implemented support for the RGB565A8 format now. Let me know once support is added in LVGL and I will add a snapshot test so it never breaks (in theory).

embeddedt avatar May 08 '22 13:05 embeddedt

I started to implement it, but it seems the RGB channel is always 0x00. I tested with this image img_cogwheel_argb

kisvegabor avatar May 10 '22 16:05 kisvegabor

Fixed! Sorry about that; somehow I only managed to check the alpha channel during my read of the file.

embeddedt avatar May 10 '22 18:05 embeddedt

No prole, thank for the fix. It's working now.

I'm implementing the transformation of rgb565-a8 image.

kisvegabor avatar May 10 '22 19:05 kisvegabor

RGB565-A8 support is added here: https://github.com/lvgl/lvgl/tree/feat/rgb565a8

kisvegabor avatar May 10 '22 19:05 kisvegabor

Hi @embeddedt, I am trying to test the newly added colour format RGB565-A8, and don't know how to use the converter. For this colour format, which option should I choose?

image

https://lvgl.io/tools/imageconverter

Thank you.

GorgonMeducer avatar May 16 '22 18:05 GorgonMeducer

You will need to use this link: https://lvgl.github.io/lv_img_conv/ until Gabor has a chance to update the main website. It should be the last color format in the list.

embeddedt avatar May 16 '22 19:05 embeddedt

I just updated the version on lvgl.io

kisvegabor avatar May 16 '22 19:05 kisvegabor

Thank you. I found it.

GorgonMeducer avatar May 16 '22 20:05 GorgonMeducer

Hi i a am not sure if regression is related to this update but seems so. https://lvgl.io/tools/imageconverter do not output true color binary anymore.

luka177 avatar May 22 '22 12:05 luka177

@luka177 Could you let me know which settings you are using and what is the exact change in behavior? Thanks!

embeddedt avatar May 22 '22 12:05 embeddedt

image this settings. after clicking convert nothing happens. debian-big this is my image

luka177 avatar May 22 '22 12:05 luka177

@luka177 Thanks, this was indeed a regression, sorry about that (there are no unit tests on that part of the code right now). Here is a link that should work till the website is updated again: https://lvgl.github.io/lv_img_conv/

embeddedt avatar May 22 '22 13:05 embeddedt

I've updated the online converter too.

kisvegabor avatar May 24 '22 13:05 kisvegabor

Thanks seems to work now.

luka177 avatar May 25 '22 07:05 luka177