possible bug -channel a or [mean] string format

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug -channel a or [mean] string format

Post by fmw42 »

IM 6.8.9.0 Q16 Mac OSX.

The following is, if not a bug, at least very confusing

If I run the following command, I get a zero result indicating that the alpha channel is perfectly transparent as expected.

Code: Select all

convert rose: -alpha transparent -channel a -separate -scale 1x1! -format "%[fx:u]\n" info:
0

If I run these two commands, I get a non-zero result, in fact, the largest possible value indicating that it is reporting the opacity and not the alpha channel.

Code: Select all

convert rose: -alpha transparent -channel a -format "%[mean]\n" info:
65535

convert rose: -alpha set -channel a -evaluate set 0 -format "%[mean]\n" info:
65535

I though all references to -channel A were now transparency and not opacity. Please clarify.



This appears to be a bug, since I get NAN for the result

Code: Select all

convert rose: -alpha transparent -channel a -separate -format "%[mean]\n" info:
nan
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug -channel a or [mean] string format

Post by snibgo »

Yes, it does seem to be reporting opacity instead of transparency.

F:\web\im>%IM%convert rose: -alpha transparent -channel A -evaluate add 25% -format "%[mean]\n" info:
49151

F:\web\im>%IM%convert rose: -alpha transparent -channel A -evaluate add 75% -format "%[mean]\n" info:
16383

F:\web\im>%IM%convert rose: -alpha transparent -channel A -evaluate add 100% -format "%[mean]\n" info:
0
snibgo's IM pages: im.snibgo.com
Post Reply