Inkplate 6COLOR RGB color palette for pure colours

Customer:

I’m mostly a designer and have a small project which downloads the Inkplate update periodically from my server. The library only defines the pure colours as bits 1-7, but I’m pasting an image generated with PHP over the full page and need them as RGB values. Where can I find this documentation?

Originally submitted via email support on 13 July 2023. Migrated to the forum for community visibility.

Soldered Support:

The drawImage function will be the most convenient approach. After your server generates the image, upload the .jpg to the server, get a link to it, and use that link in Inkplate’s drawImage function to display it on the ePaper.

Sending raw image data would be complicated since Inkplate 6COLOR uses a special “2 pixels per byte” buffer - you would have to convert your image before being able to display it on Inkplate.

Please look at Examples>Inkplate library>Inkplate 6COLOR>Advanced>Web_WiFi>Inkplate6COLOR_Show_Pictures_From_Web.

Customer:

I already generate and update the image this way - that part works on both ends.

The issue is the palette. I can’t figure out the proper RGB values for the pure colours. When I display red, I see pixels in orange and green that shift the perceived colour.

Soldered Support:

Here are the hex color codes which Inkplate 6COLOR uses:
{0x000000, 0xFFFFFF, 0x00FF00, 0x0000FF, 0xFF0000, 0xFFFF00, 0xFF8000}

If you draw these colors on Inkplate without dithering the image, they will stay exactly like this, pixel perfect. These colors are from the library - look in the file ImageDithercolor.cpp. These were changed somewhat recently to fix errors in their definition which resulted in lower quality images.

Make sure you have the latest version of the Inkplate library installed.

Customer:

I don’t have the code for Inkplate and the library is probably ~6 months old. After rereading your reply, I think dithering is the difference. I have it turned on, but if pixel perfection and colour purity only work with dithering off, that would explain the problem. I enabled dithering initially because it seemed like the right choice when I first played with Inkplate.

I may have the code on an old computer, but at this point I’d rather live with dithered colours than try to reconstruct everything.

Soldered Support:

Here’s a pro-tip: you can pre-dither part of an image if you want certain things pixel-perfect and other parts dithered.

Pre-dither the part of the image you want dithered using https://doodad.dev/dither-me-this/ and set the color palette to: {0x000000, 0xFFFFFF, 0x00FF00, 0x0000FF, 0xFF0000, 0xFFFF00, 0xFF8000}

Then place this pre-dithered image into your graphics design program. The image will be dithered but perfectly aligned to the pixel grid. When you draw this image without additional dithering, it will retain its pre-dithered look perfectly.

So you can pre-dither the parts you want dithered, add them to your final image, and then display everything without additional dithering.

Attachment omitted in migration: image.png

Attachment omitted in migration: image.png