mean.a incorrect

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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

mean.a incorrect

Post by snibgo »

IM v6.9.2-5 on Windows 8.1.

Code: Select all

convert xc:White xc:None xc:None +append -format %[fx:mean.a] info:

0.666667
The image has two pixels with a=0 and one pixel at a=1. So the mean should be 0.33333.

This worked fine in v6.9.1-6. Perhaps the fix to alpha minima >= maxima caused this problem.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: mean.a incorrect

Post by magick »

Try
  • convert xc:White xc:None xc:None +append -format '%[fx:mean.o]' info:
    0.666667
Which displays the mean opacity rather than alpha. Is that not correct?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: mean.a incorrect

Post by snibgo »

Which displays the mean opacity rather than alpha. Is that not correct?
No, it isn't correct. We have one white pixel (alpha = opacity = 1) and two transparent black pixels (alpha = opacity = 0). (1+0+0)/3 = 0.3333.
snibgo's IM pages: im.snibgo.com
Post Reply