Open teplit opened 4 years ago
Do you have a precise use case to do that? PNG format is just good to screen capture or web app. For photos, if you need losseless format, just prefer Tiff format. Furthermore, even would it work, ICC profile would not be included, making the file useless. Some app have a workaround putting exif data in a PNG chunk, but it's just a kack as it is not standardized.
RawTherapee 5.8 saves successfully PNG files with the following color profiles (the list is not exhaustive):
Apparently PNG is a first class format in RawTherapee.
I’m not a PNG format expert. However I did a simple experiment in order to see where exactly RawTherapee stores the ICC profile in a PNG file. With the aid of TweakPNG I did the following:
Why this works? RawTherapee writes the ICC profile in an iCCP chunk, and Photoshop recognizes that chunk. Guess what will happen if you delete the iCCP chunk…
Is this a hack? No, it is not – the iCCP chunk is part of the PNG specification - http://www.libpng.org/pub/png/spec/iso/index-object.html#11iCCP
Is the EXIF data important to keep in an exported image from RawTherapee? For me it is not. Something else - the EXIF data can cause privacy problems if it contains GPS data and real names, and for “professionally processed” photos that look more like paintings than photographs it is practically irrelevant.
Are PNG files useful only for screenshots and web graphics? They are useful for many more things – for example computer generated graphics with more than 8 bits per channel.
The failure of RawTherapee to save PNG file with ProPhoto profile is a manifestation of defect.
Something more – the EXIF does not record what filter (or combination of filters) you used in front of your lens and what extension tube (or combination of extension tubes) you put on the back of the lens. Also it does not record the RAW processing corrections and manipulations. Some people are quite happy to look at fake autumnal photo without realizing that the photo was taken in the summer...
The problematic ProPhoto profile is attached here. I got it from %SystemRoot%\System32\spool\drivers\color . I don't know which application put it there (most likely Adobe Photoshop).
In order to reproduce the problem you need to place this profile in the color profiles directory specified in RawTherapee Preferences ► Color Management. Then you may need to restart RawTherapee for the change to take effect.
The problem manifests on Windows 10 machines (real and virtual), but not on Linux (at least not on my OpenSUSE virtual machine).
RawTherapee 5.8 ships with several output profiles. Unfortunately they are not documented well in RawPedia - for example RTv4_Large and RTv4_Wide are not documented. Also there is no explanation for the differences between v2 and v4 profiles.
So, just to comment: I think that when an output file of 0 bytes is produced, this is a bug and should be considered a failed export. As mentioned by @teplit embedded profiles in exported png's are possible and should be possible according to the spec. Now the only thing is how to find the bug :-)
@teplit The ProPhoto profile you mention is a default profile that comes with Windows (afaik).
RawTherapee 5.8 creates zero bytes PNG file with an error message when the Output Profile is ProPhoto.
Steps to reproduce the problem:
Tested on two computers - one with Windows 10 (1909) and the other with Windows 8.1.