Code: Select all
$ magick rose: -grayscale rec709luminance -colorspace sRGB rose-grayscaleLuminance.png
$ magick -intensity rec709luma rose: -grayscale rec709luminance -colorspace sRGB rose-intensityLuma-grayscaleLuminance.png
$ magick +intensity rose: -grayscale rec709luminance -colorspace sRGB rose+intensity-grayscaleLuminance.png
rose-intensityLuma-grayscaleLuminance.png (unnecessarily darkened)
rose+intensity-grayscaleLuminance.png (unnecessarily darkened)
(Notes:
- The darkening above is *not* similar to the normal effect of -grayscale rec709luma or the default -colorspace gray as these don't produce nearly such a dark result.
- The final "-colorspace sRGB" conversions before saving each png file above aren't important but they are just there to avoid linear png which would be displayed differently by various software, sometimes appearing dark but sometimes not, merely because some software ignores the gamma=1. The issue I'm submitting here is *not* related to transforming specifically to sRGB afterward.
- The issue I'm submitting here is also *not* specific to PNG output. I didn't want to use JPEG files simply because they also have a separate issue with linear grayscale images, which is being discussed in a separate bug topic: viewtopic.php?f=3&t=32666 )
(Of course once we understand the present issue, we can work around it, for example right after the -grayscale operation we can explicitly apply an appropriate -intensity rec709luminance or rec601luminance to the image, or -set colorspace RGB {as opposed to a different -colorspace operation, which generally wouldn't help})
(BTW the only reason the problem doesn't occur the other way around, with -intensity rec709luminance and -grayscale rec709luma for example leading to an overly LIGHT result, is that there is currently an asymmetry in the way IM treats linear and nonlinear intensities: a Gray image with a linear intensity is generally treated as nonlinear unless accompanied by an exact gamma=1, while a nonlinear or undefined intensity is treated as nonlinear irrespective of gamma.
I've tried to document this and other behavior of intensity in my proposed "-intensity" documentation update in another topic here: viewtopic.php?f=3&t=32548#p149319 -- please take a look!)