This is fine with respect to reporting the colorspaces, but has several ramifications.
As before defining colors, srgb(...) and rgb(...) are still non-linear. So similarly sgray(...) and gray(...) shades are also non-linear.
I note that icc-colors, however, allow either non-linear or linear. This permits direct creation of non-linear colors or grays, which is nice.
Code: Select all
convert xc:"rgb(255,0,0)" non-linear_red.png
convert xc:"srgb(255,0,0)" non-linear_red.png
convert xc:"icc_color(srgb,1,0,0)" non-linear_red.png
Code: Select all
convert xc:"icc-color(rgb,1,0,0)" linear_red.png
Code: Select all
convert xc:"gray(255)" non-linear_white.png
convert xc:"sgray(255)" non-linear_white.png
convert xc:"icc-color(sgray,1)" non-linear_white.png
Code: Select all
convert xc:"icc-color(gray,1)" linear_white.png
There is one ramification of the current change that troubles me.
To create non-linear gray shades or convert color images to non-linear gray, one now uses the new colorspace sgray
Code: Select all
convert logo: -colorspace sgray logo_nonlinear_gray.png
Code: Select all
convert logo: -colorspace gray logo_linear_gray.png
I would prefer that we keep -colorspace gray as non-linear for backward compatibility as I have many scripts that would need changing.
In order to then create linear gray shades or convert color to linear gray, I would suggest just keeping the existing -grayscale or -intensity and icc-color(gray, ...). For example
Code: Select all
convert logo: -grayscale rec709luminance logo_linear_gray.png
convert logo: -intensity rec709luminance -colorspace gray logo_linear_gray.png
convert xc:"icc_color(gray, 0.5) logo_linear_gray.png
And for non-linear, keep using -colorspace gray or -grayscale.
Code: Select all
convert logo: -colorspace gray logo_nonlinear_gray.png
convert logo: -grayscale rec709luma logo_nonlinear_gray.png
convert xc:"icc_color(sgray, 0.5) logo_nonlinear_gray.png