Open ghost opened 4 years ago
Hi @VortexTheCortex ! Thank you for this feature request. I'm not very familiar with EXR files, so can I ask some follow-up questions?
First, a brief explanation of where PhotoDemon is at right now. PhotoDemon currently supports EXR files thanks to the 3rd-party FreeImage I/O library (https://sourceforge.net/projects/freeimage/). FreeImage doesn't support multi-layer EXR files, which is why PhotoDemon also doesn't support them.
To remedy this, I would need to drop FreeImage as my EXR engine and switch to something like OpenEXR. This is not a small project, unfortunately, and it would require me to maintain a separate OpenEXR build just for PhotoDemon.
I can start investigating this option, but I need to clarify some compromises that PhotoDemon has to make when working with EXR data. I want to make sure these compromises are okay before I go too deep down this rabbit hole.
1) PhotoDemon needs to down-convert EXR data to 32-bit RGBA data internally. This can mean a significant loss of precision depending on the original EXR data format. What type of EXR files are you saving, and is it okay that they get downsampled to 32-bit RGBA when editing in PhotoDemon? 2) From what I can see, EXR layer support is not agreed upon by all software - e.g. here are the Blender devs discussing problems sharing multi-layer EXR data with other editors. Do you have a specific program you are trying to support, so I know which multi-layer approach I should target? 3) Do you know of any other open-source photo editors that support multi-layer EXR files? Typically I need a few other programs to use for testing, to ensure PhotoDemon's files behave correctly when importing/exporting from other editors.
Thanks for any follow-up information you can provide!
Thank you for responding!
The EXR format I’m saving in already is 32 bit RGBA.
I’m saving the EXR files from Blender 2.90.
The only other program I know uses multi-layer EXR files is Krita, but I don’t use it since it has problems with the color space which I can’t seem to fix
Perfect, thank you for the follow-up info @VortexTheCortex !
One last question for you. Can you attach one of your multi-layer EXR files to this issue? That would give me a good place to start my testing. Thank you!
Thank you for the sample image, @VortexTheCortex! It's perfect. Having a small test image will be a huge help in figuring out how to make multilayer EXR support happen.
My next step is actually to share this feature request upstream, with the FreeImage library devs. Dozens of open-source apps use that library for handling EXR images, and if I can get FreeImage to implement mutli-layer support, it will save me a ton of time - and perhaps more importantly, it increases the odds of the wider open-source ecosystem improving its EXR coverage. That's the "best solution" if it works out.
If the FreeImage developers can't/won't do it, I'll look at tackling this in my own way, but I'd really like to see this feature spread to as many projects as possible, since it sounds like multilayer EXR support is not where it needs to be right now in many apps.
Thank you for your patience (especially as I've been slow to respond), and I'll link my upstream bug report here once it's filed.
I really appreciate you looking into this! I wish you the best of luck.
I've finally posted a request to FreeImage's developer page:
https://sourceforge.net/p/freeimage/feature-requests/60/
Fingers crossed for a positive response!
That's awesome to hear!
I was hoping that I would be able to do some post work for my 3D renders in PhotoDemon when I saw it supported EXR, but it looks like it can only open EXR files that don't have multiple layers inside. I think adding Multilayer EXR support would take some of the tediousness out of the workflow (e.g., exporting each render pass one by one), for me and other 3D artists using the program.