Create a ARGB8888 image


I tried to use the 32 bit image in LVGL, but i’m unable to show this type of image.

What MCU/Processor/Board and compiler are you using?

What LVGL version are you using?


What do you want to achieve?

I want to show a 32 bit image on my display.

What have you tried so far?

I have created a bmp image using paint. I have saved the image as 24 bit bmp and after, using LVGL image converter, I create a C array using the true color chroma key option. The lv_conf is configured as you see in the next section.
However the image that my display show are different from the original.
I miss something?

Code to reproduce

/* Color depth:
 * - 1:  1 byte per pixel
 * - 8:  RGB233
 * - 16: RGB565
 * - 32: ARGB8888
#define LV_COLOR_DEPTH     32

/* Swap the 2 bytes of RGB565 color.
 * Useful if the display has a 8 bit interface (e.g. SPI)*/
#define LV_COLOR_16_SWAP   0

/* 1: Enable screen transparency.
 * Useful for OSD or other overlapping GUIs.
 * Requires `LV_COLOR_DEPTH = 32` colors and the screen's style should be modified: `style.body.opa = ...`*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

The problem seem to be the LV_COLOR_DEPTH 32 define and the true color chroma key option in the image converter tool.
I have tryed with the image flower_icon_alpha.png that are in the image example folder.
If I convert this image using the option true color chroma key and if I use the LV_COLOR_DEPTH 32, the image that is showed in the display is wrong. If I use the LV_COLOR_DEPTH 16, the image is visible on the display, but the background is black, not transparent.
If I convert the image using the option true color with alpha and if I use the LV_COLOR_DEPTH 16 the image is showed correctly…
Where I’m wrong?

I attach my main file and the c file of image converted. You need to change the LV_COLOR_DEPTH with 16 or 32 to see the difference on the display.

main.c (5.5 KB) sfondo_with_alpha.c (177.5 KB) sfondo_with_chroma_key.c (133.5 KB)