Edit: Another reason that Glennrp pointed out for retaining (rather than replacing/redefining) Gray is that Gray also serves as a more generic grayscale colorspace (e.g. I would say whose interpretation may or may not resemble a "gray" or lightness or based on sRGB, e.g. could be the b or U channel of Lab or LUV).
PROPOSAL: add a new colorspace sGray so that
Code: Select all
convert image.miff -colorspace sGray
Update: The result will look very similar to Adobe sGray, which is their grayscale version of sRGB (see below).
What many people expect in a grayscale version of a color image is not arbitrary, but rather it should be a gray shade that doesn't appear darker or lighter (to a typical human) than the original color.
If we can agree in principle that it might be useful to be able to accomplish this, then we can discuss the mechanics of how to achieve this goal. Please don't say "it can't be done uniquely so I don't want to try" -- if you agree that it would be useful *if* it could done uniquely, or at least in a way that's closer to accomplishing this goal than the current default of -colorspace gray is, then I can explain how.
This is just one example so doesn't prove anything by itself, but I believe these images that Fred recently made illustrate what the current -colorspace gray (middle) and proposed -colorspace sGray results (bottom) will be, each in comparison separately to the original color "rose:" (top). The bottom one should look more like the original color image than does the middle one (at least to a typical trichromat human using accurate viewing software and hardware).
fmw42 wrote:Here are the results of processing the rose: image with the fix for gamma in IM 6.8.7.1
nonlinear grayscale:
imbh convert rose: -colorspace sRGB -grayscale rec709luma rose_luma.png
Update: the result just above will be produced by my proposal without using color profiles, but looks very similar to the result of the following ICC conversion in IM:fmw42 wrote:imbh convert rose: -colorspace sRGB -grayscale rec709luminance -set colorspace RGB -colorspace sRGB rose_luminance.sRGB3.png
Code: Select all
im convert rose.png -set profile sRGB.icc -profile sGray.icc rose.sGray.png
The middle image appears to be the same as I get today with with "convert rose: -colorspace sRGB -colorspace gray rose_colorspacegray.png", which makes sense if rec709luma is indeed today's default.
(Eventually I would also like to add a linear grayscale colorspace, e.g. "Luminance" or "LinearGray" or "Cie1931LinearY", but that can be a separate discussion as it isn't as much of a priority for me if gamma=1 on a Gray image is able to elicit most of the same behavior from IM.)