Page 1 of 1

potential bug -alpha off ... -alpha on IM 7

Posted: 2018-10-08T16:21:59-07:00
by fmw42
This command works fine in IM 6.9.10.12 Q16 Mac OSX.

Code: Select all

convert icon.png -alpha off -fuzz 50% -fill "#550000" -opaque "#000000" -alpha on icon2.png
But fails in IM 7.0.8.12 Q16 Mac OSX Sierra.

Code: Select all

magick icon.png -alpha off -fuzz 50% -fill "#550000" -opaque "#000000" -alpha on icon2.png
Images and reference discussion at https://imagemagick.org/discourse-serve ... =1&t=34834

It does work in IM 7 using -channel RGB rather than -alpha off

Re: potential bug -alpha off ... -alpha on IM 7

Posted: 2018-10-09T16:41:21-07:00
by magick
ImageMagick 7 has variable channels per https://imagemagick.org/script/porting.php. When you turn alpha off, the alpha channel is tossed. When you re-enable, it adds back an opaque alpha channel. ImageMagick 6 is different, the alpha channel persists when it is turned off and restored when it is turned back on. What you want instead is to deactivate the alpha channel instead of turning it off, use -alpha Deactivate. Deactivating persists the alpha channel but does not use it for blending pixels for certain image processing options.

Re: potential bug -alpha off ... -alpha on IM 7

Posted: 2018-10-09T16:48:25-07:00
by snibgo
Perhaps in v7, "-alpha Deactivate" and "-alpha Activate" do what "off" and "on" did in v6.

Re: potential bug -alpha off ... -alpha on IM 7

Posted: 2018-10-09T18:05:13-07:00
by fmw42
snibgo wrote: 2018-10-09T16:48:25-07:00 Perhaps in v7, "-alpha Deactivate" and "-alpha Activate" do what "off" and "on" did in v6.
Yes, that works. Thanks, snibgo.

This needs to be documented in the Porting doc page. I do not see -alpha activate/deactivate listed there.