inky icon indicating copy to clipboard operation
inky copied to clipboard

CI: Rewrite set_image for Spectra 6 to handle more edge cases

Open Gadgetoid opened this issue 5 months ago • 1 comments

We've had various problems with the image remapping code (particularly where P mode images have more than six colours), most of which was very, very old code I wrote back when I had much less idea what I was doing.

This rewrite should fix all cases by avoiding as much special casing as possible. The one exception is where a P mode image has no palette at all, and thus no colour information. For example the Hello World example uses palette indexes but never creates a palette (image.palette.colors == {}) so attempting to quantize it has very bizarre results.

  1. [x] Test for https://github.com/pimoroni/inky/issues/227
  2. [x] Test https://github.com/pimoroni/inky/pull/221 fixes this case (it does not)
  3. [x] Test https://github.com/pimoroni/inky/pull/221 looks good! (N/A)
  4. [x] New goal: Rewrite set_image

Gadgetoid avatar Jun 16 '25 09:06 Gadgetoid

I have tested it and now the pre-dithered image is left alone.

bablokb avatar Jun 17 '25 11:06 bablokb