When using indexed color modes, why was it made so the palette needs to be stored together in the same array as the pixel data?

As I understand, if you want an indexed color mode image to be displayed with lv_img_set_src, it’s palette needs to be stored in the same array as the pixel data, example:

const LV_ATTRIBUTE_MEM_ALIGN uint8_t my_image_map[] PROGMEM = {
    0x00, 0x00, 0x00, 0xFF, /* Color of index 0 */
    0xFF, 0xC5, 0xFF, 0xFF, /* Color of index 1 */
    0x40, 0x20, 0x23, 0xFF, /* Color of index 2 */
    0x00, 0x00, 0xFF, 0xFF, /* Color of index 3 */
    
    // Pixel data 
    0xAA, 0xAA, 0xAA, 0xAA, 0xA9, 0x95, 0x5A, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x56, 0x56, 0x96, 
    0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x56, 0xAA, 0xAA, 
    0xAA, 0xAA, 0xA6, 0x65, 0x59, 0x99, 0x99, 0x99, 0x55, 0x55, 0x55, 0x55, 0x5A, 0x96, 0xAA, 0xAA, 
    0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x56, 0xAA, 0xAA, 0xAA, 0xAA,
    ........ 
};

This can be overcome by not using a const but then the image lives in RAM, instead of const PROGMEM in FLASH.

Maybe you could look into storing the palette data outside of the pixel map array so you could more easily change the palette globally at runtime.

Maybe palette can be a style property or so.

@AndreCostaaa let’s keep it mind when we design the new image system for v10.

As it is now, the only way to achieve this is with a custom image decoder, or storing the native I2 format in RAM rather than FLASH?