What do you want to achieve?
Use 24-bit color depth. LVGL v9+ added support for 24-bit color.
Do you see alternative options and workaround to achieve it?
Using 32-bit color depth does work with LVGL configured for 24-bit color depth, but the generated ui.c file adds an preprocessor check to ensure the color depth matches and errors if it doesn’t. I’m assuming some images could also be optimized for 24-bit displays.
Mention some use cases
We use 24-bit frame buffer to reduce required size of frame buffers and reduce bandwidth requirements during flushing.
Hi, thanks, this is a valid request, and it’s on our list. Until native 24-bit support lands, your workaround is the way to go: keep 32-bit in SquareLine Studio and set LV_COLOR_DEPTH 24 in lv_conf.h, then strip the color-depth check from the exported ui.c (e.g. as a pre-build step: sed -i '/TEST LVGL SETTINGS/,/#endif/d' ui.c).
One caveat for images: on LVGL 9.0–9.5, please make sure the image format optimization option is enabled in Project Settings (or use LVGL 9.6). Otherwise opaque images are exported as LV_COLOR_FORMAT_NATIVE, which resolves to RGB888 at 24-bit depth while the data is 32-bit, and they will render incorrectly. With the optimization enabled, images are written with explicit formats (RGB888/ARGB8888/indexed), and those work fine on a 24-bit display.