Page 1 of 1

LVGL 9.4 ESP32-P4 Extremely slow image rendering from filesystem lv_image_set_src(img, "A:/SPIFFS/img.bin")

Posted: Mon Dec 22, 2025 11:08 pm
by ae68547
Hi everyone,

I’m using LVGL 9.4.0 with ESP-IDF 5.5.1 on an ESP32-P4-NANO, and I’m seeing a very large performance gap when displaying images depending on how LVGL accesses them.

I use
ESP32-P4-NANO
Waveshare display 800×1280
PSRAM enabled @ 200 MHz
Filesystem: SPIFFS
LVGL color depth: RGB565
No compression

Same image (800×1280), same format, same display code.
C-array image (compiled into firmware)
lv_image_set_src(img, &img_800x1280);
Displays in < 1 second

Binary image loaded via LVGL filesystem
lv_image_set_src(img, "A:/SPIFFS/img.bin");
Takes more than 10 seconds

Does anyone know why LVGL image loading from filesystem is so slow?

Re: LVGL 9.4 ESP32-P4 Extremely slow image rendering from filesystem lv_image_set_src(img, "A:/SPIFFS/img.bin")

Posted: Tue Dec 23, 2025 1:10 am
by lbernstone
Because the flash, vfs and filesystem (esp SPIFFS) are much slower about moving data than a memory mapped array.
You can likely speed things up quite a bit by caching the file from flash into psram, and then calling the lvgl function with the psram pointer. It's still my preference to inline file assets like that into the firmware as you have done, both for the performance increase and for easier maintenance when you update the firmware.