Max hue in -verbose

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Max hue in -verbose

Post by snibgo »

As usual, the bug is probably in my understanding.

Code: Select all

convert rose: -colorspace HSL -verbose info:

Code: Select all

  Channel statistics:
    Red:
      min: 0 (0)
      max: 255 (0.999771)
      mean: 64.8731 (0.254404)
      standard deviation: 84.3511 (0.330788)
      kurtosis: 0.401251
      skewness: 1.35605
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 143.598 (0.56313)
      standard deviation: 79.6782 (0.312464)
      kurtosis: -1.48781
      skewness: -0.120986
    Blue:
      min: 5 (0.0189364)
      max: 255 (1)
      mean: 66.1317 (0.25934)
      standard deviation: 58.9262 (0.231083)
      kurtosis: 1.82335
      skewness: 1.39176
The "red" channel is really hue, of course, which goes round in a circle. I suppose that 256 == 0.

By my arithmetic, 64.8731/255 = 0.254404 and 84.3511/255 = 0.330788, near enough. That's fine.

But 255/255 != 0.999771. What gives?
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Max hue in -verbose

Post by anthony »

SOunds like a bug its probably calculating 255/256 whcih is of course wrong.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply