upvote
Fred's dominantcolor script for imagemagick might work for you:

https://www.fmwconcepts.com/imagemagick/dominantcolor/index....

reply
Back in the late 1980s people thought about color quantization a lot because a lot of computers of the time had 16 or 256 colors you could choose out of a larger palette and if you chose well you could do pretty well with photographic images.
reply