fix(color mgmt): More sensible OCIO file rules#5194
Open
lgritz wants to merge 1 commit into
Open
Conversation
Oh dear, a recent discovery: OCIO's built-in configs' "file rules" that come into play when using getColorSpaceFromFilepath actually does not incorporate the search for color space name embedded in the filename into the logic, and moreover, assume that files ending in ".exr" are ACES2065-1, of all things. This seems an unfortunate choice because in the real world, almost no exr files people will encounter actually use the ap0 primaries. This PR does the following to shore up this and related edge cases: * For OCIO built-in configs, fully replace the existing file rules with a blank slate that just uses the path parsing rule. Everything else is categorized as "unknown". (Though many of our format readers already do something better, setting the metdata if they actually know what the file is.) * Recognize "unknown" is equivalent to having an empty color space, an error if you pass such a color space name to IBA color transform functions. * For all IBA color conversion, if the input space is not color managed, be sure NOT TO mark the output color space as the original `to` request! Input raw means output is also raw. Signed-off-by: Larry Gritz <lg@larrygritz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently discovered that OCIO's built-in configs' "file rules" that come into play when using getColorSpaceFromFilepath actually do not incorporate the search for color space name embedded in the filename into the logic, and moreover, assume that files ending in ".exr" are ACES2065-1, of all things. This seems an unfortunate choice because in the real world, almost no exr files people will encounter actually use the ap0 primaries.
This PR does the following to shore up this and related edge cases:
For OCIO built-in configs, fully replace the existing file rules with a blank slate that just uses the path parsing rule. Everything else is categorized as "unknown". (Though many of our format readers already do something better, setting the metadata if they actually know what the file is.)
Recognize "unknown" as equivalent to having an empty color space, an error if you pass such a color space name to IBA color transform functions.
For all IBA color conversion, if the input space is not color managed, be sure NOT TO mark the output color space as the original
torequest! Input raw means output is also raw.