[ Request ] image zoom support for index color 16 bit format too

In some case true color format image source is too large but it can zoom.
When reduce to index color16bit format for tiny size.
It seems can’t zoom.

Wish image widget support for index color 16 bit format too.

Thank you very much.

The problem with indexed colors, in this regard, that the colors can’t be interpolated. For example if you zoom and RGB image to x1.5 size, 2 adjacent pixel should behave like this:
RED, WHITE -> RED, ROSE, WHITE

You can’t do the same with indexed colors:
0, 10 -> 0, 5, 10 doesn’t make sens.

However an non-antialiased zoom still would be possible:
0, 10 -> 0, 0, 10

1 Like

If you were willing to take a hit in performance, and you had a palette with a reasonable number of shades of the same color, perhaps one could scan the palette and choose the closest color to the interpolated value. It definitely wouldn’t be perfect, but the quality might be reasonable enough.

The disadvantage is that scanning through the whole 256-color palette to find the closest color is very slow, even on an STM32F7 (a previous GUI library I worked with used this technique for other reasons).

1 Like

Interesting idea, but find it a little bit over kill. I think one can accept this limitation with indexed colors.

May I ask what was the library? :slight_smile:

1 Like

It was Nano-X.

1 Like