Hmm.
Ok, here’s what I’ve learned today:
- If all three channels of an image are identical, imagemagick will automatically set the colorspace to
grayscale
.
a. If it’s a jpeg, to fix this, set-define colorspace:auto-grayscale=off
b. If it’s a PNG, set the output file toPNG24:outfile.png
For example, on Imagemagick 6.9.5-7 Q16:
$ convert.exe linear-rec2020-radial-smooth-gradients.png test.png
convert: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG 'test.png' @ warning/png.c/MagickPNGWarningHandler/1656.
- The logic to manage this edge case severely complicates the forum image handling code.
The solution
If you need to use weird colorspaces or custom profiles, then zip/tar/bzip the file up and upload that. Then you can be assured the file will transfer as-is.
Other images you want people to see should all work fine, even in sRGB, AdobeRGB or some other colorspace (that is, our patch from last year should have fixed the colorspace getting nuked).