Page 2 of 2

Re: Replace ANY colour Except #ffffff with #000000

Posted: 2014-06-21T17:10:24-07:00
by Rye
Thats odd... when I execute that command once

Code: Select all

for %%x in (*gif) do convert %%x ( -clone 0 -fill black -colorize 100 ) +swap -alpha set ( -clone 1 ( -clone 0 +transparent #F4F4FC ) ( -clone 0 +transparent #F7F7FF ) ( -clone 0 +transparent #F9F9FF ) -delete 0 -evaluate set 0 -layers flatten -negate ) -compose Over -composite %%x
once, I get this:
Image

twice this:
Image

and three times this...
Image

and the colorize IS already on 100... either I'm missing something here... or...

Re: Replace ANY colour Except #ffffff with #000000

Posted: 2014-06-21T17:21:30-07:00
by fmw42
Your image tags are malformed. They seem to be missing the closing [/img]


When in doubt, run the command on one single image and put -write statements throughout the code at the end of each parenthesis to check the progress of the commands and to be sure they are doing what is intended.

see
http://www.imagemagick.org/script/comma ... .php#write
http://www.imagemagick.org/Usage/files/#write (but do not add +delete as shown in these examples)

Re: Replace ANY colour Except #ffffff with #000000

Posted: 2014-06-22T04:49:53-07:00
by Rye
fixed

Re: Replace ANY colour Except #ffffff with #000000

Posted: 2014-06-22T05:17:16-07:00
by snibgo
It needs a "-background White":

Code: Select all

convert ^
  s001.gif ^
  ( -clone 0 -fill Purple -colorize 100 ) ^
  +swap ^
  -alpha set ^
  ( -clone 1 ^
    ( -clone 0 +transparent #F4F4FC ) ^
    ( -clone 0 +transparent #F7F7FF ) ^
    ( -clone 0 +transparent #F9F9FF ) ^
    -delete 0 ^
    -evaluate set 0 ^
    -background White ^
    -layers flatten ^
    -negate ^
  ) ^
  -compose Over -composite ^
  s1.png