2

I want to replace green pixels in this png file with gray ones.

Based on official examples, I tried the command below and got this result filled with white not gray.
It becomes white even if other color codes are set for -fill {COLOR}.
What's wrong with my command?

convert -opaque "#00b051" -fill "#808080" -fuzz 20% -strip grid{,_mod}.png

Environment:

❯ brew info imagemagick
==> imagemagick: stable 7.1.0-54 (bottled), HEAD

> sw_vers
ProductName:    macOS
ProductVersion: 12.6.2
BuildVersion:   21G320

> sysctl -n machdep.cpu.brand_string
Apple M1 Pro

> brew --version
Homebrew 3.6.15-33-g884c4be
Homebrew/homebrew-core (git revision 03ac47958ed; last commit 2022-12-16)
Homebrew/homebrew-cask (git revision 81aa381950; last commit 2022-12-16)

1 Answer 1

2

Do you try to put options in this order:

  1. -fuzz ...
  2. -fill ...
  3. -opaque ...

Like this:

convert kL63gnJ.png -fuzz 20% -fill "#808080" -opaque "#01b050" kL63gnJ-new.png

This seems really important.

3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .