[Solved] How to remove all color except 3, and resize canvas
Posted: 2011-05-15T10:18:52-07:00
Hi all.
input.png:

I use:
output.png:

I want to separate them, like this:
( Note: I don't know the color order, I just know these colors, and the result must be the same order. Sorry I didn't told this condition before.)

I had tried ( -clone 0 -fill white +opaque #339966 -transparent white -background transparent -extent 200% -gravity center ), but failed.
input.png:

I use:
Code: Select all
convert input.png ( -clone 0 -fill white +opaque #339966 -transparent white ) ( -clone 0 -fill white +opaque #FFCC00 -transparent white ) ( -clone 0 -fill white +opaque #CCFFCC -transparent white ) -delete 0 -background white -flatten output.png

I want to separate them, like this:
( Note: I don't know the color order, I just know these colors, and the result must be the same order. Sorry I didn't told this condition before.)

I had tried ( -clone 0 -fill white +opaque #339966 -transparent white -background transparent -extent 200% -gravity center ), but failed.