Osqui
Osqui

Reputation: 218

How to replace one color in a image with another one?

I've this image:

enter image description here

Its background (and only) color is "#687a40" but want to change it for the color "#9ea09a" (a light grey).

I've tried with this command...:

gm convert photo.png -fuzz 0% -fill "#9ea09a" -opaque "#678a40" photoGREY.png

...but I've not seen any effect on the image. I'm sure I'm doing something wrong but GM's documentation is not very friendly.

Upvotes: 0

Views: 204

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207465

Your image has an alpha channel, so you need:

gm convert input.png -fill "#9ea09a" -opaque "#687a40ff" result.png

Upvotes: 1

Related Questions