Load image form file system,color changed?

I created a bmp file,like this

but ssimulation with VS ,result like this,

did i miss something?

How are you loading the file? Please provide a code sample.

lv_obj_t * icon = lv_img_create(NULL, NULL);


/*From file*/
lv_img_set_src(icon, "S:C:\\Users\\LIU\\Desktop\\test.bin");
  • The bin image and the LV_COLOR_DEPTH has the same value?
  • Please try to save it in PNG and try again.
  1. I chose Binary RGB565,and LV_COLOR_DEPTH is 16.

  2. I try this,but it not worked for me.

  3. Whitch the original format is the most suitable?
    I used JPG,PNG,BMP,only few of them succeed.


  1. List item you said that you created BMP file, but in forum you attached JPG file. Can you attach original source file here?

  2. Which version of the LVGL are you using?

  3. Does your BMP file has transparent background?

1 can not upload BMP file
2 7.0.0
3 no

I upload the file and main.c . you can use it simluate in VS.

BMP_800x480.zip (2.5 MB)

main.c (8.7 KB)

below is the the test code

	lv_obj_t * icon = lv_img_create(NULL, NULL);
	lv_img_set_antialias(icon, true);


	/*From file*/
	lv_img_set_src(icon, "S:C:\\Users\\LIU\\Desktop\\test.bin");

hi, I used Microsoft Paint,and salved as 24 bit BMP,it is works.
But files in the zip,can not work,even salved as 24 bit BMP.
can you test it.

Maybe the image converter can’t handle some color formats of some file types correctly.
@embeddedt is rewriting the image converter, and probably it will work in more reliable way.

If you found a working format I suggest using that until the new converter is released.

ok,I am looking forward it ,thanks.