1937 views|3 replies

274

Posts

8

Resources
The OP
 

[Sipeed LicheeRV 86 Panel Review] 7 - lvgl Solution to the problem of incorrect image color display [Copy link]

 

When using lvgl for display on Lichee RV86, I found that the color of the picture was not displayed correctly. I tried the following methods, but none of them solved the problem .

  1. Change the image format from png to jpg
  2. Image conversion format, change the conversion format from "True color" to "True color with alpha"
  3. Change the background color and transparency of the picture control
  4. Close the default Waft program

So I thought of using the three primary colors to see where the colors are wrong. The following pictures are the original picture and the displayed picture.

Comparing the two pictures above, we can see that the positions of blue and red are reversed, resulting in incorrect color display.

So I tried to check "Output in big-endian format" when converting the image, and found that the correct color could be displayed (see the figure below).

The URL for image conversion is: https://lvgl.io/tools/imageconverter

The root cause of this error is the incorrect setting of the big and small end of the data . Changing the way to generate pictures does not fundamentally change the problem of incorrect system colors. When calling color functions, the displayed colors will still be wrong.

I didn't find a way to set the big and small endianness in the lvgl library, and modifying "#define LV_BIG_ENDIAN_SYSTEM 0" in "lv_conf.h" would cause a new compilation error. So I modified the refresh function of lvgl and manually swapped the red and blue data. The method is as follows:

  • In the fb_dev.c file, modify the function "void fbdev_flush(lv_disp_drv_t drv, const lv_area_t area, lv_color_t * color_p)" and add the code in the red box.

At this point the screen color display is normal.

This post is from Domestic Chip Exchange

Latest reply

How many bits are there in the color? If it is a big-endian problem, shouldn't RGB be displayed normally if it is reversed?  Details Published on 2022-4-21 14:30
 
 

2w

Posts

74

Resources
2
 

Thanks for sharing :)

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

加油!在电子行业默默贡献自己的力量!:)

 
 
 

9702

Posts

24

Resources
3
 

How many bits are there in the color? If it is a big-endian problem, shouldn't RGB be displayed normally if it is reversed?

This post is from Domestic Chip Exchange

Comments

The data is 32 bits, and the color uses 24 of them.  Details Published on 2022-4-21 14:40
 
 
 

274

Posts

8

Resources
4
 
littleshrimp posted on 2022-4-21 14:30 How many bits are there in a color? If it is a big-endian problem, RGB should be reversed and still display normally.

The data is 32 bits, and the color uses 24 of them.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list