> If you meet with a technical friend to drink a beer, and s/he ask what your project can do, which are the 10 coolest examples that you can show?
Nothing. This is for those who already understand the benefit of shrinking images and animations using indexed palettes, and just looking for a tool to do it.
> I'm not sure how to trigger the recolorize method
You can't, that's not part of the tool. You need to implement it in your app that displays such images. That's the whole point.
To see recolorization in action, check out one of my other projects here:
https://bztsrc.gitlab.io/ludchr/ (select the icons on the right, if a layer has color options, you'll see a pop-up menu with the color variants, clicking on a color will recolorize the layer on-the-fly)
> Also, they show a strange pallete. I'd prefer a version that shows
That's exactly what the image shows.
First figure: original image minus the palette equals decolorized image.
Second figure: decolorized image plus palette equals multiple colorized outputs.
The palette can be provided in many formats, but the palette on these figures is the actual palette image I've used with paltool. It is an image of 8 x 4 pixels, so it has 4 different gradients. Out of the 8 possible colors in each gradient only 6 used in the example, so the last 2 colors were replaced with a checkerboard on the preview (in the actual palette image these are fully transparent).
> A few years ago, my wife wanted a few gif or animals with different colors. I used gimp to find the correct entry in the pallete and then I changed the value of that entry in the pallete directly in the files.
That's exactly what decolorization and recolorization is for. I needed this for the ludchr project above.
> Can your program find the optimal pallete?
No such thing exists, except for pixel art maybe.
My program uses multiple methods, calculates scores for each (depending on the distance to the original) and picks the one with the best score. Otherwise it is built around the libimagequant library. https://github.com/ImageOptim/libimagequant
The palette might contain fixed colors, and free slots are filled with quantized colors from the image. If the image has no more different colors than the specified maximum, then yes, the palette will be optimal, otherwise you must make peace with some information loss.
> A long time ago I had to transform a color 256^3 image to a 256 colors image. IIRC I used gimp and paint and perhaps a few more programs. But the palette choice was bad and caused too many quirks.
Yes, that's exactly why I've created this tool. I was also struggling with GIMP (unable to handle alpha channel in palettes) and Imagemagick (unable to handle animated PNGs).
My tool does not reinvent the wheel, it just provides an easy to use interface (CLI as well as a free web-service) around already existing and known to work methods.