-intensity documentation

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

-intensity documentation

Post by snibgo »

The page http://www.imagemagick.org/script/comma ... #intensity says:
Typically the linear Rec709Luminance formula is used, which is the same formula used when converting images to -colorspace gray.
This is wrong, as "-colorspace gray" uses the Rec709Luma formula. It always has. This can be shown:

Code: Select all

f:\web\im>%IMG7%magick ( toes.png -colorspace Gray ) ( toes.png -grayscale Rec709Luma ) -metric RMSE -format %[distortion] -compare info:
0

f:\web\im>%IMG7%magick ( toes.png -colorspace Gray ) ( toes.png -grayscale Rec709Luminance ) -metric RMSE -format %[distortion] -compare info:
0.261518
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -intensity documentation

Post by fmw42 »

You are correct. It must be a typo or a remnant from when grayscale was linear.

Also I would have expected these formulae to be using non-liner, R', G' and B' values rather than the linear R, G, B

Average (R + G + B) / 3.0
MS (R^2 + G^2 + B^2) / 3.0
RMS sqrt( (R^2 + G^2 + B^2) / 3.0 )

Was it intended to use linear combinations here or is this also a remnant form the days when single channels were linear?
Post Reply