Code: Select all
magick rose: rose.hdr (okay)
magick rose.hdr rose.hdr.jpg (okay)
magick rose.hdr rose.hdr.png (too dark unless you account for the gamma=1 and ignore colorspace)
magick rose.hdr.png rose.hdr.png.hdr (too dark)
magick rose.hdr.png.hdr rose.hdr.png.hdr.png (still too dark)
. . . (getting darker and darker...)
. . .
If you view any of the images near the bottom of this list, you'll see that most of the image is lost to near-blackness.
Code: Select all
CSpc Gam Fmt Dep Mean Min Max Name
sRGB .454545 PPM 8 .412342 .0862745 1 rose:
sRGB .45455 PNG 8 .412342 .0862745 1 rose.png
sRGB .454545 JPEG 8 .412056 .0823529 1 rose.jpg
sRGB .454545 JPEG 8 .410574 .0823529 1 rose.hdr.jpg
RGB 1 HDR 16 .218564 .0078125 1 rose.hdr (this one looks fine in an hdr viewer as it was correctly linearized by IM)
sRGB 1 PNG 16 .218564 .0078126 1 rose.hdr.png (looks too dark, but allegedly "correct" because it has GAMA=1)
RGB 1 HDR 16 .123177 0 1 rose.hdr.png.hdr (too dark)
sRGB 1 PNG 16 .123177 0 1 rose.hdr.png.hdr.png (still too dark regardless of gamma=1 or not)
RGB 1 HDR 16 .078639 0 1 rose.hdr.png.hdr.png.hdr (getting darker and darker as you go down this list)
sRGB 1 PNG 16 .078638 0 1 rose.hdr.png.hdr.png.hdr.png
RGB 1 HDR 16 .054094 0 1 rose.hdr.png.hdr.png.hdr.png.hdr
sRGB 1 PNG 16 .054094 0 1 rose.hdr.png.hdr.png.hdr.png.hdr.png
sRGB .454545 JPEG 8 .057767 0 1 rose.hdr.png.hdr.png.hdr.png.hdr.png.jpg
As far as I can tell, just about all software including imagemagick itself considers the image data in a png file to be in sRGB colorspace, irrespective of the GAMA chunk.
So when IM reads back in the "linear png" file that it just wrote, it treats the data as sRGB, and it thus becomes "too dark".
What if we were to stop trying to write "linear png" files, and instead implicitly convert linear (or other non-sRGB) images to sRGB by default in order to write them to png, just like when we write them to jpeg?
In my opinion there's very little downside to doing this.
I can't think of any real necessity for creating a linear png -- usually one would use tiff or any of the hdri or floating-point (or linear-only) formats to store a linear image.
But if anyone really finds that the ability to write a linear png is important, perhaps there could be another way to do so, such as format PNGLINEAR: or PNGGAMMA: wherein the gamma value would be preserved and the image not converted to sRGB -- but in my opinion this behavior should not be the default for ordinary PNG format(s) like it is today.
What do you think -- am I off base here?