Skip to content
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

ImageReader : Conform lower case "r", "g", "b" and "a" to upper #5868

Merged
merged 1 commit into from
May 29, 2024

Conversation

johnhaddon
Copy link
Member

The EXR standard states that it is only the upper case "R", "G", "B" and "A" that have a predefined interpretation, and that is how we treat channels in GafferImage. But in the last week I've received files from two different sources both using lower-case, so this seems worth fixing up on load.

In the latter case, the file was from Blender and only the Cryptomatte channels were lowercased. To my surprise, that is actually enshrined in the Cryptomatte specification. I can't find a source for why, but based on Psyop/Cryptomatte#35 it seems that maybe it's to disable lossy DWA compression when the DCC won't let you control that per-file or per-part? That seems to call into question the entire idea of using RGBA to represent ID and coverage in the first place, which I believe was originally to play well in apps that only recognised RGBA.

In conjunction with #5867, this fixes #5866.

The EXR standard states that it is only the upper case "R", "G", "B" and "A" that have a predefined interpretation, and that is how we treat channels in GafferImage. But in the last week I've received files from two different sources both using lower-case, so this seems worth fixing up on load.

In the latter case, the file was from Blender and only the Cryptomatte channels were lowercased. To my surprise, that is actually enshrined in the Cryptomatte specification. I can't find a source for _why_, but based on Psyop/Cryptomatte#35 it seems that _maybe_ it's to disable lossy DWA compression when the DCC won't let you control that per-file or per-part? That seems to call into question the entire idea of using RGBA to represent ID and coverage in the first place, which I believe was originally to play well in apps that only recognised RGBA.

In conjunction with GafferHQ#5867, this fixes GafferHQ#5866.
@danieldresser-ie
Copy link
Contributor

LGTM - it's no more hacky than any of the other heuristics.

@johnhaddon johnhaddon merged commit ad2895b into GafferHQ:main May 29, 2024
5 checks passed
@johnhaddon johnhaddon deleted the conformLowercaseRGBA branch August 7, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cryptomatte from Blender 3.x/4.x is not Displayed in Viewer
2 participants