Skip to main content

Image Formats

TouchGFX supports multiple image formats. The image formats are supported only with the framebuffer formats where they make sense. The tables below the supported image- and framebuffer formats.

The first two table explains the image formats. The next tables list the framebuffer formats. The last table shows the supported image formats on the different framebuffer formats.

Image Formats

These are the image formats supported by TouchGFX:

Image formatSupports TransparencyImage size (W x H)Description
ARGB8888YesW x H x 432 bits, 8 bits per component
L8_ARGB8888YesW x H + Colors x 48 bits indexed format, ARGB8888 palette
RGB888NoW x H x 324 bits, 8 bits per component.
L8_RGB888NoW x H + Colors x 38 bits indexed format, RGB888 palette
RGB565NoW x H x 216 bits, 5 bits red, 6 bits green, 5 bits blue
L8_RGB565NoW x H + Colors x 28 bits indexed format, RGB565 palette
ARGB2222YesW x H8 bits, 2 bits per component
ABGR2222YesW x H8 bits, 2 bits per component
RGBA2222YesW x H8 bits, 2 bits per component
BGRA2222YesW x H8 bits, 2 bits per component
GRAY4No~ (W / 2) x H4 bits grayscale
GRAY2No~ (W / 4) x H2 bits grayscale
BWNo~ (W / 8) x H1 bit grayscale
BW_RLENo< (W / 8) x H1 bit grayscale run-length encoded

The image formats that supports transparency are bigger because the must encode the transparency information (the alpha values). They are also slower to draw into the framebuffer. They are typically used for icons, shades, elements with round corners etc.

The image formats that does not support transparency are always rectangular. They are almost always faster because they fully cover the background behind, which is then not drawn.

Compressed Image formats

Image formatDescription
Compressed L8_ARGB88888 bits indexed format, ARGB8888 palette. The pixels are compressed. The palette is not.
Compressed L8_RGB8888 bits indexed format, ARGB8888 palette. The pixels are compressed. The palette is not.
Compressed L8_RGB5658 bits indexed format, ARGB8888 palette. The pixels are compressed. The palette is not.
Compressed RGB565Compressed RGB565 pixels
Compressed RGB888Compressed RGB888 pixels
Compressed ARGB8888Compressed ARGB8888 pixels

Compressed images uses less space, but are generally slower to draw and can not be used everywhere.

Further reading
Read more about compressed images here: Image Compression
Caution
Compressed images can not be used with all Widgets. See the list.

Framebuffer formats

TouchGFX has built-in support for the following framebuffer formats:

Framebuffer FormatBits pr. pixelNumber of colors
ARGB888832 bpp16777216 colors and corresponding opacity values
RGB88824 bpp16777216 colors
RGB56516 bpp65536 colors
ARGB22226/8 bpp64 colors
RGBA22226/8 bpp64 colors
BGRA22226/8 bpp64 colors
ABGR22226/8 bpp64 colors
GRAY44 bpp16 grayscale colors
GRAY22 bpp4 grayscale colors
BW1 bpp2, black and white

There are limitations on the use of the framebuffer formats with some display connections:

Framebuffer FormatDisplay connection type supported directly
ARGB8888LTDC, DSI, Custom
RGB888LTDC, DSI, Partial framebuffer, Custom
RGB565LTDC, DSI, FMC, Partial framebuffer, Custom
ARGB2222LTDC, DSI, Custom
RGBA2222LTDC, DSI, Custom
BGRA2222LTDC, DSI, Custom
ABGR2222LTDC, DSI, Custom
GRAY4Custom
GRAY2Custom
BWCustom

The "Custom" display connection means that the TouchGFX Generator does not generate all the code needed to the display the framebuffer. TouchGFX will draw all frames into the framebuffer, but the user must handwrite all code required to transmit the framebuffer to the display and to synchronize the TouchGFX Engine with the display refresh.

Further reading
Read more about custom display interfaces here: FMC and SPI Display Interface.

Supported image formats on framebuffer formats

The table below shows which image formats that are supported for a given framebuffer format.

Framebuffer FormatSupported Image formats
ARGB8888RGB565
RGB888
ARGB8888
L8_RGB565
L8_RGB888
L8_ARGB8888
Compressed RGB565
Compressed RGB888
Compressed ARGB8888,
Compressed L8_RGB565
Compressed L8_RGB888
Compressed L8_ARGB8888
RGB888RGB888
ARGB8888,
L8_RGB888
L8_ARGB8888
Compressed RGB888
Compressed ARGB8888
Compressed L8_RGB888
Compressed L8_ARGB8888
RGB565RGB565
ARGB8888
L8_RGB565
L8_RGB888
L8_ARGB8888
Compressed RGB565
Compressed ARGB8888,
Compressed L8_RGB565
Compressed L8_RGB888
Compressed L8_ARGB8888
ARGB2222ARGB8888
ARGB2222
RGBA2222ARGB8888
RGBA2222
BGRA2222ARGB8888
BGRA2222
ABGR2222ARGB8888
ABGR2222
GRAY4GRAY4
GRAY2GRAY2
BWBW
BW_RLE

Platforms with the GPU2D accelerator does not support the L8_RGB565 and Compressed L8_RGB565 image formats.