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 format | Supports Transparency | Image size (W x H) | Description |
---|---|---|---|
ARGB8888 | Yes | W x H x 4 | 32 bits, 8 bits per component |
L8_ARGB8888 | Yes | W x H + Colors x 4 | 8 bits indexed format, ARGB8888 palette |
RGB888 | No | W x H x 3 | 24 bits, 8 bits per component. |
L8_RGB888 | No | W x H + Colors x 3 | 8 bits indexed format, RGB888 palette |
RGB565 | No | W x H x 2 | 16 bits, 5 bits red, 6 bits green, 5 bits blue |
L8_RGB565 | No | W x H + Colors x 2 | 8 bits indexed format, RGB565 palette |
ARGB2222 | Yes | W x H | 8 bits, 2 bits per component |
ABGR2222 | Yes | W x H | 8 bits, 2 bits per component |
RGBA2222 | Yes | W x H | 8 bits, 2 bits per component |
BGRA2222 | Yes | W x H | 8 bits, 2 bits per component |
GRAY4 | No | ~ (W / 2) x H | 4 bits grayscale |
GRAY2 | No | ~ (W / 4) x H | 2 bits grayscale |
BW | No | ~ (W / 8) x H | 1 bit grayscale |
BW_RLE | No | < (W / 8) x H | 1 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 format | Description |
---|---|
Compressed L8_ARGB8888 | 8 bits indexed format, ARGB8888 palette. The pixels are compressed. The palette is not. |
Compressed L8_RGB888 | 8 bits indexed format, ARGB8888 palette. The pixels are compressed. The palette is not. |
Compressed L8_RGB565 | 8 bits indexed format, ARGB8888 palette. The pixels are compressed. The palette is not. |
Compressed RGB565 | Compressed RGB565 pixels |
Compressed RGB888 | Compressed RGB888 pixels |
Compressed ARGB8888 | Compressed ARGB8888 pixels |
Compressed images uses less space, but are generally slower to draw and can not be used everywhere.
Further reading
Caution
Framebuffer formats
TouchGFX has built-in support for the following framebuffer formats:
Framebuffer Format | Bits pr. pixel | Number of colors |
---|---|---|
ARGB8888 | 32 bpp | 16777216 colors and corresponding opacity values |
RGB888 | 24 bpp | 16777216 colors |
RGB565 | 16 bpp | 65536 colors |
ARGB2222 | 6/8 bpp | 64 colors |
RGBA2222 | 6/8 bpp | 64 colors |
BGRA2222 | 6/8 bpp | 64 colors |
ABGR2222 | 6/8 bpp | 64 colors |
GRAY4 | 4 bpp | 16 grayscale colors |
GRAY2 | 2 bpp | 4 grayscale colors |
BW | 1 bpp | 2, black and white |
There are limitations on the use of the framebuffer formats with some display connections:
Framebuffer Format | Display connection type supported directly |
---|---|
ARGB8888 | LTDC, DSI, Custom |
RGB888 | LTDC, DSI, Partial framebuffer, Custom |
RGB565 | LTDC, DSI, FMC, Partial framebuffer, Custom |
ARGB2222 | LTDC, DSI, Custom |
RGBA2222 | LTDC, DSI, Custom |
BGRA2222 | LTDC, DSI, Custom |
ABGR2222 | LTDC, DSI, Custom |
GRAY4 | Custom |
GRAY2 | Custom |
BW | Custom |
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
Supported image formats on framebuffer formats
The table below shows which image formats that are supported for a given framebuffer format.
Framebuffer Format | Supported Image formats |
---|---|
ARGB8888 | RGB565 RGB888 ARGB8888 L8_RGB565 L8_RGB888 L8_ARGB8888 Compressed RGB565 Compressed RGB888 Compressed ARGB8888, Compressed L8_RGB565 Compressed L8_RGB888 Compressed L8_ARGB8888 |
RGB888 | RGB888 ARGB8888, L8_RGB888 L8_ARGB8888 Compressed RGB888 Compressed ARGB8888 Compressed L8_RGB888 Compressed L8_ARGB8888 |
RGB565 | RGB565 ARGB8888 L8_RGB565 L8_RGB888 L8_ARGB8888 Compressed RGB565 Compressed ARGB8888, Compressed L8_RGB565 Compressed L8_RGB888 Compressed L8_ARGB8888 |
ARGB2222 | ARGB8888 ARGB2222 |
RGBA2222 | ARGB8888 RGBA2222 |
BGRA2222 | ARGB8888 BGRA2222 |
ABGR2222 | ARGB8888 ABGR2222 |
GRAY4 | GRAY4 |
GRAY2 | GRAY2 |
BW | BW BW_RLE |
Platforms with the GPU2D accelerator does not support the L8_RGB565 and Compressed L8_RGB565 image formats.