cancel
Showing results for 
Search instead for 
Did you mean: 

The sequence of color changed when touchgfx generate the .png image source code?

alivexiaoluo
Associate III

Hi,

I want to ask if the sequence of color changed when touchgfx generate the .png image source code.

The r255g000b000_480_640.png image is red in RGB888(0xff0000),when touchgfx generate the image_r255g000b000_480_640 source code in RGB888 is 0x0000ff.

If i miss something in image settings?

Thanks for your attention. 

r255g000b000_480_640.png iamge in touchgfx.

0693W00000BaLoIQAV.png 

image_r255g000b000_480_640 source code in mdk.

0693W00000BaLoXQAV.png

1 ACCEPTED SOLUTION

Accepted Solutions
Alexandre RENOUX
Principal

Hello alivexiaoluo,

It's because the framebuffer format of the LTDC in 24bit mode is BGR when seen as bytes. It's similar for 32bpp where RGBA is stores as BGRA when seen as bytes because of little endian.

If you don't use LTDC, you can use DMA2D to swap the order from BGR to RGB.

But overall, for many display interfaces you can configure the order of bytes you send.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

View solution in original post

2 REPLIES 2
Alexandre RENOUX
Principal

Hello alivexiaoluo,

It's because the framebuffer format of the LTDC in 24bit mode is BGR when seen as bytes. It's similar for 32bpp where RGBA is stores as BGRA when seen as bytes because of little endian.

If you don't use LTDC, you can use DMA2D to swap the order from BGR to RGB.

But overall, for many display interfaces you can configure the order of bytes you send.

When your question is answered, please close this topic by choosing Select as Best.

/Alexandre

Hi,Alexandre RENOUX.

I set the lcd driver chip (Sitronix ST7701S register 36H)to rgb mode, the display works fine.

Thanks for your help.