Convert png image always zero

Hi guys,

I used the https://lvgl.io/tools/imageconverter to convert PNG file to c array file, the array value always 0x00. If the upload JPEG file, works fine.

Maybe the PNG file has a special color format. I suggest opening and saving it with an image editor software.

cc @embeddedt

If it still doesn’t work, is it possible to send the PNG file so I can investigate it?

@embeddedt Thanks for your reply, here is my PNG file
wifi-connection-offline

This issue is caused by the fact that your image consists of a black icon on top of a black background. The background is normally hidden by the alpha (transparency) channel, but in your case I assume you converted using “true color” mode which ignores the alpha channel.

There are two ways to fix this:

  • Convert using “true color with alpha” mode.
  • Edit the image in GIMP or a similar tool to replace the transparent parts with a white background, then convert using “true color” mode.
1 Like