问题
Tried to replace all colors except yellow (with some -fuzz) to transparent without result. Didn't find anything in documentation maybe someone can help me.
Thank you.
As I know in ImageMagic there is +opaque, but I can't use this library
回答1:
This should do what you want. It makes the yellow pixels transparent and then inverts the alpha channel.
gm convert input.png +matte -matte -fuzz 5% -transparent yellow -operator matte negate 1 output.png
The "+matte" removes any existing transparency that might be in the input.png, then "-matte" adds an opaque alpha channel.
Tested with GraphicsMagick-1.3.20.
来源:https://stackoverflow.com/questions/27178320/graphicsmagick-replace-all-colors-except-yellow-to-transparent