I have 2 images and the only difference is the color.

I use the image converter to make the 2 images into indexed 16 format and C array.
I notice that the 2 images are almost same except the first 64 bytes. I guess it’s the palette.
So I want to know how to change the palette insdead of use 2 images. Because my flash is small(STM32CBT6).
You should be able to use the recoloring feature of the image object for this purpose. Have a look at the documentation here and here.
I have tried change “intense” to 128 and 255.
lv_style_copy(&PageData->logo1Style, &lv_style_plain);
PageData->logo1Style.image.color = LV_COLOR_RED;
PageData->logo1Style.image.intense = 128 ;
lv_img_set_style(PageData->logo1Img, LV_IMG_STYLE_MAIN, &PageData->logo1Style);
And they look like the follow figures(the white one is not set the style)
And the ‘128’ looks OK, but there some red shadow around the logo.
I just want to recolor the logo, not include the background.
The picture is “indexed 16”.
Did I miss something?
I suppose the image has black background which is also recolored.
You can manually change the opacity of the black color in the palette to 0x00
.
0x00, 0x00, 0x00, 0xff, /*Color of index X */
to
0x00, 0x00, 0x00, 0x00, /*Color of index X*/