The generated bin file is copied to SPIFFS partition, I have wrote a SPIFFS wrapper following online documentation and it seems working.
The issue is that global rendering of picture is noisy, still some dots appear around not transparent areas when should be transparent
Here the picture : (sorry for quality)
I have tried every format and settings in online converter - redo the picture to be sure the noise does not come from original picture, I use jpg because png rendering is not correct, like a blue filter on image.
If I use full transparent image (filled with transparent color) no noise, image is fully transparent =>ok
If I do not use transparent color, no noise but image of course has no transparency=>ok
Do I miss some settings ? Do I do something wrong ?
Or it is a bug with transparency ? Or with Online converter ?
I do not know where to look at, thanks for your help
By default when saving png Bit Depth was set to Auto-detect which bring random rendering depending on content: black image, blue image, etc, set 8 bits or 32 bits give same results, but looks like 24bits is ok, no noise, proper rendering.
Windows Paint does not give choice and seems ok out of the box.
I am not familiar with image settings, I was confused with LV_COLOR_DEPTH 16 so did not tried the 24bits.
This is interesting. Ideally the image converter should be able to handle PNGs of any depth. Maybe this is something we need to look into? I’ll test it soon.
I’ve never tested it but I assume with lower color depth it tells the pixel values as they are. So if Red has 0…31 range it doesn’t scale it up to 0…255.
One note about transparency, may be it is a known issue :
Using Theme will affect transparency rendering, for example using green as transparent color will stay green in image if Mono theme is used but will be transparent with default theme.
Well this is embarassing - it seems I am back to square 1 - issue I thought coming from theme, came in fact from conversion, even in normal theme transparency is not taken in account, (using new snap feature)
![logo|200x150]
I enclose the original png file : logo.zip (2.5 KB)
and the converted file esplogo.c (1.5 MB)
/* Maximal horizontal and vertical resolution to support by the library.*/
#define LV_HOR_RES_MAX (480)
#define LV_VER_RES_MAX (320)
/* Color depth:
* - 1: 1 byte per pixel
* - 8: RGB233
* - 16: RGB565
* - 32: ARGB8888
*/
#define LV_COLOR_DEPTH 16
/* 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 = ...`*/
#define LV_COLOR_SCREEN_TRANSP 0
/*Images pixels with this color will not be drawn (with chroma keying)*/
#define LV_COLOR_TRANSP LV_COLOR_LIME
/* Enable anti-aliasing (lines, and radiuses will be smoothed) */
#define LV_ANTIALIAS 1
I am sure I was able to do transparency before, but not anymore
The difference is before I used external binary when now I use C array, I think.
Check that LV_COLOR_LIME has the same RGB value as the green pixels in your PNG file (using something like GIMP). It’s possible that they are slightly different shades of green. You might need to modify LV_COLOR_TRANSP appropriately.
and I confirme now ok on my main program.
and to come back to the note : the issue is not the theme, transparency works well with mono theme
Sorry for the confusion - I did not trigged the root cause properly
Issue is definively the green transparency not seen on my 16 Bit depth system, could it be because of this bit depth and so color 0x00, 0xFF, 0x00 can not be reached due to RGB565 ?
It is not a real problem now I know ^_^: Png 24bit and 0xFF, 0x00, 0xFF for transparency color
The first pixel in the converted image has 0xe0, 0x07 value. It’s Little endian so the real value is 0x07, 0xe0. In binary 0000 0111 1110 000. In RGB565 R00000, G111111, B00000. So the converted image should be fine.
The chrome keying is handled here:
It should be worth some debugging to see what have happened.
and purple image bg I got transparency and output is : chroma_key: 0X000001, px_color.full:0X00F81F, chroma_key && px_color.full:0X000001, disp->driver.color_chroma_key.full:0X00F81F
and green image bg I do not get transparency and output is: chroma_key: 0X000001, px_color.full:0X0007E0, chroma_key && px_color.full:0X000001, disp->driver.color_chroma_key.full:0X00F8
Edit : I realize I misread chroma_key && px_color.full == disp->driver.color_chroma_key.full
should be : chroma_key && (px_color.full == disp->driver.color_chroma_key.full) to avoid confusion, but output is still meaninful
Let me know if you need me to add more info on debug