I wonder how I could create a image with a transparent background and only 2 indexed colours (red and blue) to minimise the file size?
More specifically I have two black and white images that I want to convert, one to transparent and blue and the other to transparent and red. Then I want to merge those 2 images. I could do that with a regular RGBA image, but I really want the colour to be indexed to minimise the file size.
Ideally with PIL, but other Python library could also work.
So I managed to do it, using "palette" image type, but the resulting file is not as small as I expected... Here's my code in case its useful for someone else, or if someone can improve on it.