LVGL 9 equivalent of LV_COLOR_CHROMA_KEY?

What is the LVGL 9.x.x equivalent functionality to LV_COLOR_CHROMA_KEY? This was a nice way to have more compact formats (RGB565 for instance) have an effective alpha channel without the extra byte per pixel, as the pixel color matching LV_COLOR_CHROMA_KEY was not drawn.

The online converter doesn’t seem to offer any guidance, or the docs, and I’ve tried a few formats with the python converter, but to no avail.

I’m stuck with a bunch of images with a bright green background now :slight_smile:

Sharing for others looking for a workaround, in case it helps! My use-case is drawing a clock face (several different images), with the corners of the square image around the curve of the clock set to the chroma color (bright green in my case), with those pixels made transparent in LVGL 8 with LV_COLOR_CHROMA_KEY. Without that in 9, I get squares with bright green corners. As a workaround for now, I created a mask image:

mask240x240

converted it to L8 format with the offline python script and apply like so:

  LV_IMG_DECLARE(dsc_mask240x240);

  //Create a mask draw_buf
  static lv_draw_buf_t clockMask = { 
    .header = { 
                .magic = LV_IMAGE_HEADER_MAGIC, 
                .cf = LV_COLOR_FORMAT_L8, 
                .flags = LV_IMAGE_FLAGS_MODIFIABLE,
                .w = 240,
                .h = 240,
                .stride = LV_DRAW_BUF_STRIDE(240, LV_COLOR_FORMAT_L8),
                .reserved_2 = 0,
              },
    .data_size = 240 * 240,
    .data = dsc_mask240x240.data,
    .unaligned_data = dsc_mask240x240.data,
  };

  //Set the mask on the clock face canvas (which is LV_COLOR_FORMAT_RGB565)
  lv_obj_set_style_bitmap_mask_src(clock_canvas, &clockMask, LV_PART_MAIN | LV_STATE_DEFAULT);

but this also requires me to enable LV_DRAW_SW_SUPPORT_L8 and LV_DRAW_SW_SUPPORT_AL88 (to blend?) in lv_conf.h, so it significantly increase the ‘fast’ ITCM memory use with the extra code, and is a tad slow :slight_smile:

One of the clockface images:
blue_undone240x240

Screenshot with image and mask under LVGL 9: