A
A
Andrzej Wielski2015-11-27 22:34:38
PHP
Andrzej Wielski, 2015-11-27 22:34:38

How to extract (keep) only certain colors in an image?

There is, for example, such an image.
c60aa767b3f14286a6406f6192337132.png
The goal is to remove everything except the following colors:
9e84cb787ced4d7fa3c2c8f4cf0b1d87.png
Please suggest an idea, how best to do this?
Googling hasn't brought any results.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2015-11-27
@wielski

Just a nice script for this task: www.fmwconcepts.com/imagemagick/mapcolors/index.php
For red:

convert input.png -fill white -fuzz 10% +opaque "#FF0000" result.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question