0

I have images like this ones:

enter image description here

And I want to change its colour palette so they look like this one:

enter image description here

What I do is to reduce the amounts of colours in the image to a specific subset of 17. I need to be this specific 17 because I have to apply this process to around 700 images and I need consistency.

When I use gimp to archive this goal what I usually do is to create a colour palette based on an image and then Image > Mode > Indexed and choose the colour palette.

My plan was to do something similar using Pillow, but I haven't been able to find a successful way to do it.

Any suggestions? Should I try a different approach?

Thanks!

edoelas
  • 317
  • 2
  • 13
  • 1
    There are two solutions here... https://stackoverflow.com/a/57204807/2836621 – Mark Setchell May 20 '20 at 08:50
  • maybe it can be converted with tools like [imagemagick](https://imagemagick.org/) and then you can use Python `os.system()` only to execute `imagemagick`. – furas May 20 '20 at 09:54

0 Answers0