Reducing image resource usage in embedded GUI applications
When developing embedded GUIs, many projects encounter a familiar challenge: image resources begin consuming a significant amount of Flash before the interface becomes complex. Icons, buttons, status indicators, logos, and other assets may seem small individually, but their cumulative footprint can reduce the space available for future features.
I8 (Indexed 8-bit) is an effective option for reducing image storage while preserving acceptable visual quality. This guide explains the fundamentals of I8, its suitable use cases, and practical recommendations for using it in GUI Guider projects.
In MCU-based projects, image resources often occupy a large portion of Flash. For assets with a limited number of colors, such as icons, status images, logos, and industrial HMI elements, I8 can reduce storage usage while preserving the essential visual appearance.
I8 stores an image using a pixel-index and color-palette mechanism. Each pixel stores a one-byte index, which maps to an actual color in the palette. This makes I8 especially suitable for UI assets with concentrated color sets, clear boundaries, and highly graphical content.
|
Image Format |
Typical Storage per Pixel |
Suitable Use Cases |
|
RGB888 |
3 bytes |
Images with rich colors and high color-fidelity requirements |
|
RGB565 |
2 bytes |
Common MCU displays balancing visual quality and resource usage |
|
ARGB8888 |
4 bytes |
Images requiring an alpha channel and high-quality rendering |
|
I8 |
1 byte + palette |
Icons, logos, and HMI elements with a limited color set |
I8 stands for Indexed 8-bit. Instead of storing complete color information in every pixel, an I8 image stores an 8-bit index that points to a color in a palette. Because an 8-bit value represents up to 256 indices, an I8 image supports a maximum of 256 colors. This format is well suited to UI assets with limited colors, sharp boundaries, and graphic-style content.
Prefer PNG assets with a limited number of colors. Before importing an image, check whether it contains excessive gradients or photographic content.
Add the image resources through Resource Manager and select an appropriate color format based on the display requirements of the project.
Convert suitable resources to I8 and preview the visual result in GUI Guider.
Use GUI Guider Simulator to check color rendering, transparent regions, edge transitions, and the overall appearance of the page.
After confirming that the result meets the requirements, generate the code and verify the application on the target development board.
The following theoretical estimates illustrate the resource usage of different formats. Actual size depends on image content, palette size, compression, and project configuration.
|
Test Resource |
Image Format |
Theoretical Data Size |
|
128 × 128 icon |
RGB565 |
Approximately 32 KB |
|
128 × 128 icon |
ARGB8888 |
Approximately 64 KB |
|
128 × 128 icon |
I8 |
Approximately 16 KB + palette |
From a resource-budget perspective, I8 reduces image storage when the color count can be controlled. The cumulative savings become more significant in HMI projects that contain many icons and status images.
The core limitation of I8 is the palette size, so images with fewer colors are the best candidates.
Even when an image contains relatively few colors, verify the result both in GUI Guider Simulator and on the target hardware.
For images with transparent or anti-aliased edges, check for jagged borders, artifacts, or unnatural colors after conversion.
I8 is an optimization technique, not the default choice for every asset. Complex backgrounds and photographic resources should continue to use a more appropriate color format.
In the GUI Guider Air Conditioner and Agriculture Control templates, selected images use I8 to save storage space and enable deployment on the FRDM-MCXN236 development board.
The Air Conditioner application template contains many animations and small icons. The comparison below shows ARGB8888 and I8 results. While maintaining image quality, I8 saves approximately 950 KB, allowing the application to run on the FRDM-MCXN236 development board.
|
|
Figure 1. Air Conditioner comparison: I8 (left) and ARGB8888 (right).
In the Agriculture Control application template, using I8 saves approximately 16.5 KB of storage.
|
|
Figure 2. Agriculture Control comparison: I8 (left) and ARGB8888 (right).
For small and medium-sized HMI projects on platforms such as MCX and i.MX RT, I8 is a practical method for optimizing image resources. It is particularly useful when a project contains many icons, status indicators, menu graphics, and decorative elements. Applied selectively and validated carefully, I8 can release more Flash space while maintaining an appropriate visual experience.