cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX: Discrepancy in File Size

KMew
Senior III

I am using a TouchGFX generated code to display an image, but I am getting a really large file size discrepancy and I'm unsure why the difference is so large.

First, there is the image that is saved in the assets folder of the TouchGFX folders.

Resolution: 1280 x 260

Bit Depth: 32

File Size: 41.7 kBytes

However, the file size that's in the flash when I build the project is MUCH bigger

Resolution: 347 x 50

Bit Depth: Unknown

File Size: 1.27 MBytes

0693W00000Y8nkAQAR.png 

I used the scalable image widget to add the image in the TouchGFX Designer.

Am I misunderstanding this?

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief II

Files is coded as C source image for example

  0x00, 0x03, 0x07, 0x07,

then every pixel for example RGB565 is 11 chars = file size 347x50x11 plus som headers = ...

And FYI png is compressed format normal image 1280x260x4 for 32b is 1,3M

View solution in original post

3 REPLIES 3
MM..1
Chief II

Files is coded as C source image for example

  0x00, 0x03, 0x07, 0x07,

then every pixel for example RGB565 is 11 chars = file size 347x50x11 plus som headers = ...

And FYI png is compressed format normal image 1280x260x4 for 32b is 1,3M

Hello MM.1

Ah, interesting. So that math aligns with a normal image. It seems they save the image in the resolution that the original image is and doesn't do the compression like the PC does. This is helpful info. Therefore, the way to minimize Flash usage is to minimize the size of the original image, not just making it smaller in the TouchGFX Designer.

Thank you MM!

You need in images config define how you need in code , if perfect with alpha result is 4 bytes per pixel, but without alpha 3 bytes (RGB888) and paleted compresion L8 is only one byte per pixel.
Second solution is in latest 4.21 added support for SVG Tiny vector graphics...
And dont use scaled images if isnt for size animation ...