[RESOLVED] change in behaviour of -colorize
Posted: 2012-04-18T17:55:38-07:00
IM 6.7.6.6 Q16 Mac OSX Snow Leopard
I am trying to fix a script, magicwand, that suddenly stopped working. I have traced it down to a change in behavior for -colorize. (Perhaps due to my request recently that the use of -fill none promote an alpha channel). Nevertheless, my attempts to change the offending line code in my script have met with limited/puzzling results.
In IM ImageMagick-6.7.4-10, the following worked fine (as I have backed down my version to test it)
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -fill black -colorize 100% show:
The first show: indicates that -draw is working correctly. The second show: (final result) is black everywhere, except transparent in the arm and lower body:
However in the current IM version 6.7.6.6, the second show: (i.e. result) is totally black.
In an attemp to work around it, I have tried 4 different approaches. The first 3 fail with totally black results, but the last one, though rather complex does work. I am puzzled why the first 3 do not work.
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -channel rgb -fill black -colorize 100% +channel show:
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -alpha off -fill black -colorize 100% -alpha on show:
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -channel rgb -alpha off -fill black -colorize 100% +channel -alpha on show:
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -channel a -negate +channel -background black -alpha background -channel a -negate +channel show:
Have I missed or misunderstood something?
Is there a shorter/better way to make this work again other than my last method above?
Is -colorize seeing the -fill none at the beginning and overlooking the -fill black towards the end just before it?
I am trying to fix a script, magicwand, that suddenly stopped working. I have traced it down to a change in behavior for -colorize. (Perhaps due to my request recently that the use of -fill none promote an alpha channel). Nevertheless, my attempts to change the offending line code in my script have met with limited/puzzling results.
In IM ImageMagick-6.7.4-10, the following worked fine (as I have backed down my version to test it)
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -fill black -colorize 100% show:
The first show: indicates that -draw is working correctly. The second show: (final result) is black everywhere, except transparent in the arm and lower body:
However in the current IM version 6.7.6.6, the second show: (i.e. result) is totally black.
In an attemp to work around it, I have tried 4 different approaches. The first 3 fail with totally black results, but the last one, though rather complex does work. I am puzzled why the first 3 do not work.
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -channel rgb -fill black -colorize 100% +channel show:
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -alpha off -fill black -colorize 100% -alpha on show:
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -channel rgb -alpha off -fill black -colorize 100% +channel -alpha on show:
convert logo2.png -fuzz 25% -fill none -draw "matte 160,200 floodfill" -write show: -channel a -negate +channel -background black -alpha background -channel a -negate +channel show:
Have I missed or misunderstood something?
Is there a shorter/better way to make this work again other than my last method above?
Is -colorize seeing the -fill none at the beginning and overlooking the -fill black towards the end just before it?