Page 1 of 1

Replacing Hexidecimal Colours in Image

Posted: 2016-03-07T10:23:57-07:00
by deklin
I am trying to replace yellow with blue.

This does NOT work:

Code: Select all

convert image.gif -fill #FFE087 -opaque #0000CC imageblue.gif
Image

Re: Replacing Hexidecimal Colours in Image

Posted: 2016-03-07T10:48:08-07:00
by snibgo
You have "-fill" and "-opaque" the wrong way round.

Re: Replacing Hexidecimal Colours in Image

Posted: 2016-03-07T11:55:31-07:00
by deklin
This doesn't work either:

Code: Select all

convert image.gif -opaque #FFE087 -fill #0000CC imageblue.gif

Re: Replacing Hexidecimal Colours in Image

Posted: 2016-03-07T12:05:28-07:00
by snibgo
"-opaque" is an operation. It turns pixels from whatever colour you say to the fill colour. By default, the fill colour is white. If you want to make the fill colour blue, you must set it before the "-opaque" operation.

Re: Replacing Hexidecimal Colours in Image

Posted: 2016-03-07T13:10:27-07:00
by deklin
I am working with an animated GIF.

Code: Select all

convert image.gif -fill #0000CC -opaque #FFE087 imageblue.gif
That works on one frame only. The color is changed on one frame only.

Re: Replacing Hexidecimal Colours in Image

Posted: 2016-03-07T13:55:27-07:00
by snibgo
It should work on all your frames. Any frames that contain #FFE087 will have that colour changed. But only one frame contains that exact colour. Other frames have similar but not exactly the same colours. You can see this with:

Code: Select all

convert image.gif -unique-colors +append txt:
So you need a "-fuzz".