Weird background on GIFs


I am getting a weird background on my GIFs as I cycle through them. It is worth noting that I am currently converting my GIFs to C arrays with a CF_RAW color format using LVGL’s online image converter tool. Sometimes, the background flashes white before turning transparent again. Other times, it flashes a different color. I have also observed cases where a white background persists, but the bounding box around the image is transparent.

What MCU/Processor/Board and compiler are you using?

ESP32 Lyra-T/gcc

What LVGL version are you using?


What do you want to achieve?

I would like to be able to play GIF all the way through and have it retain its transparent background.

What have you tried so far?

  • Experimenting with different GIFs
  • Trying different variations of the CF_RAW color format when using the online converter.
  • Using the LVGL simulator on Eclipse (same issue)
  • Loading a GIF from file (same issue)

Code to reproduce

    SemaphoreHandle_t xGuiSemaphore = get_semaphore();

    // Init the gif object one time
    if(!gif) {
        gif = lv_gif_create(lv_scr_act());

    while (xSemaphoreTake(xGuiSemaphore, portMAX_DELAY) != pdTRUE) {}

    lv_gif_set_src(gif, &mario_example);
    lv_obj_align(gif, LV_ALIGN_CENTER, 0, 0);


Screenshot and/or video

In these two examples, a colored background flashes before the GIF reverts to its original transparent state.


It’s harder to tell with the ghost, but you can see the outline of the bounding box near the bottom of the screen.