-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exr: support 16-bit (half) float export #11001
Conversation
|
I just tested your PR on macOS Monterrey. All new combinations of bit depth and compression export successfully and open fine in 16-bit uncompressed (or with compression settings other than DWA) also opens fine in macOS Preview, and the file size is reduced by ~50% vs 32-bit in the uncompressed case, as expected. Unfortunately, DWA compression leads to files which cannot be opened in Preview. But since it works in DWAA/DWAB compression leads to significant savings of about 5x (16-bit) or 10x (32-bit). Funnily enough, the compressed size is almost exactly the same for 16/32-bit. Is this expected? Overall, this looks good to me. |
|
Thanks for testing and reporting the in-depth findings.
Yeah, it might not read the primaries dt stores in the header... It's also not guaranteed dt stores them totally correctly, but that's a different topic/issue to be raised. There's also the question of what transfer curve this
No idea ;) Not an expert on the EXR compression schemes. It is possible that DWA first does a lossy conversion to half and then does the compression, which would make them almost identical. The comment for PXR24 says e.g. the first step is lossy conversion to 24-bit float... |
Indeed this PR seems to fix #7965 (or at least improve the situation). Without it, enabling PIZ compression reduces the size of a 32-bit EXR file from 291.8 MB to 283.3 MB. With it, the same file is compressed down to 231.1 MB. |
|
I hope it does. Labelling it as a bugfix! If you think it can be added - plz add in opening comment that it fixes the bug? |
|
As long as the API works, I would consider it a bug fix indeed. As compression ratio goes, I have noticed that any of the lossless options work poorly on 32-bit floats, but rather well (~40%) on 16-bit half type... Switching to scanlines might have also been a factor. The relatively small 100x100 tiles might have been inefficient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Also switched to simpler scanline format instead of tiled and added more compression options (assumes >= OpenEXR 2.2, available since Ubuntu 18.04; msys2, macports/homebrew already ship newer).
Also fixes #7965