-
Notifications
You must be signed in to change notification settings - Fork 620
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
Chromaticities should be a required attribute #1783
Comments
We've found the chromaticities attributes to be really unreliable. We'll probably make an official "ColorSpace" attribute that will be assumed to have the name of one of the official color spaces defined by the OCIO / color interop forum. |
Perhaps a new attribute type could either contain either a canonical name of a standard space, or a set of chromaticity values for arbitrary/custom spaces, with the library supporting conversion between the two. In any case I'm not convinced the attribute can be made 'required'. It would be fantastic if every tool and every user always understood exactly what colorspace images were in at every point in the pipeline, but that's not always the case. It would be better if the attribute is omitted unless the creator is confident the space is correct, rather than just using a default value or a guess. One reason that chromaticities is unreliable is due to some tools inserting incorrect default values just to have something there, and those are then propagated. Also, OpenEXRs that only contain matte channels, motion vectors, etc shouldn't have a color space. There are actually very few required attributes. The Header predefines a set of attributes, largely the ones necessary to be able to read the pixel data from the file. If a file is missing those, for some reason, the library will assume default values on reading the file |
Hi Igritz, Hi peterhillman, and thank you both for your wise answers. I understand your points as I further inspected the chromaticities output produced by different programs (After Effects, Blender, Unreal, DaVinci) and found them not very consistent. Multiple chromaticities for sRGB, multiple chromaticites for ACES... Nonetheless, even if unreliable, it would be useful to get a hint on how to interpret an exr.file. Anyway, if anyone is interested, I'm working on a fork of exiftool that not only complete the hash of corresponding keys for DWAA and DWAB compressions (actually displayed as 'Unknown(8)'), but also add a new 'Colorspace' tag that displays a simple colorspace name if the found chromaticites match some that I manually added :
|
I'm interested, particularly on which spaces you chose, and how you implement tolerance to permit non-exact values. Many camera manufacturers define their own gamuts: should those be included in any standard attribute definition? It would be good to know if there are spaces which have standard RGB values but a different white value (e.g. ACES but with D65 white point). If that's common then an attribute which uses named spaces might need separate strings for the RGB gamut and the whitepoint. The chromaticities attribute defaults to Rec709/sRGB, so it's surprising that there's variation there. It might depend on how attributes are transported through software which reads and writes EXRs but has its own internal metadata representation. It's possible values are being truncated or rounded as they are converted between floating point and string representations. Getting into the weeds a bit, but I suspect most standard spaces define their chromaticities using decimal values, rather than their nearest floating point equivalent, so perhaps chromaticities should be encoded as rationals rather than floating point, (e.g as 64/1000,33/1000 for the x,y coordinate of Rec709 red, and 1/3,1/3 for the white point of XYZ space) |
Hi again, thank you for your interest!
I chose spaces that I found most common in wy work, and spaces that I found
exact chromaticities for. I mostly brute force it.
For example, I exported multiple exrs from After Effects and Unreal in
different working spaces, read their chromaticities with exiftool (as
values are rounded in exrinfo), and copied them in my custom OpenEXR.pm of
exiftool source code. I plan to manually add colorspaces as I found new
ones across my journey. Maybe it is kind of dumb but I try to be pragmatic
and use it as atool to work. Maybe it could be a collaborative thing to
fill this empirical chromaticities corresponding table, as it is certainly
already partly done by compositing softwares like After effects, davinci or
Blender, that sometimes rightly auto detects and translates colorspaces of
textures.
I didn't know that camera manufacturers defined their own gamut. Thinking
of that I think that it could be interesting not to try to find the closest
colorspace, as keeping the difference could add info about the exr origin.
More clearly: if these particular chromaticities are found, it means that
is the RGB from Arri, from this camera. Same way for other sRGB
chromaticities from CG softwares : this is the sRGB of After effects, this
is the one from Unreal, etc...This way it would also carry the information
about the origin of the exr.
I agree that it could be interesting to separate gamut from white point, as
they are always the last two floating points values of the chromaticities
array.
If possible, I think that your idea to express chromaticities as rationals
instead of floating points is really great ! This way we could nullify the
floating points conversion problems.
Le jeu. 1 août 2024 à 00:35, peterhillman ***@***.***> a
écrit :
… I'm interested, particularly on which spaces you chose, and how you
implement tolerance to permit non-exact values. Many camera manufacturers
define their own gamuts: should those be included in any standard attribute
definition?
It would be good to know if there are spaces which have standard RGB
values but a different white value (e.g. ACES but with D65 white point). If
that's common then an attribute which uses named spaces might need separate
strings for the RGB gamut and the whitepoint.
The chromaticities attribute defaults to Rec709/sRGB, so it's surprising
that there's variation there. It might depend on how attributes are
transported through software which reads and writes EXRs but has its own
internal metadata representation. It's possible values are being truncated
or rounded as they are converted between floating point and string
representations.
Getting into the weeds a bit, but I suspect most standard spaces define
their chromaticities using decimal values, rather than their nearest
floating point equivalent, so perhaps chromaticities should be encoded as
rationals rather than floating point, (e.g as 64/1000,33/1000 for the x,y
coordinate of Rec709 red, and 1/3,1/3 for the white point of XYZ space)
—
Reply to this email directly, view it on GitHub
<#1783 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH4GWNDLAJEPTTUOCJJM6YTZPFRCFAVCNFSM6AAAAABLSGWWQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRRGU3TAOJVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Bugs and misinterpretation of colorimetry and its use in EXR files has permanently poisoned the use of the existing attributes. At this point I don't think we are ready to stray from the idea that EXR files contain either raw data, or scene referred data. Certainly when it comes up in TSC meetings, there is consensus not to encode camera colorimetry in an EXR file. As such, I would advocate a new string named attribute that supports a named linear color space, from the table developed by the ASWF Color Interop Forum. https://wiki.aswf.io/display/CIF/Color+Interop+Forum+Home If we do want to encode primaries and whitepoint beyond that, then we should deprecate the existing attributes, and name new ones and declare that the new attributes if they exist, must not be filled with nonsense. |
As a practical matter, I don't think we should absolutely require it to be on the CIF list, but rather that the CIF list names should always mean what they say, if used. It should be ok to use any OCIO built-in or in-config name (+1 for a second standard attribute naming the config that is being referenced, if it's neither CIF nor built-in). |
Working as in the CG industry for quite long now, and it is always a pain to know what is the original colorspace of any exr, without knowing before hand its export settings.
We always have to know or be be the author of the exr to know how to work with properly.
For example, exporting exr from Blender, we have no way to know what colorspace an exr is encoded in. You can only guess that it is sRGB encoded because you KNOW that it was rendered with Blender because you know it, or because you recognized the pattern of attributes in metadata like "Camera" and "Scene".
It would also be awesome if an attribute like "colorspace" or "gamut" existed, that auto translates chromaticities coordinates to their human readable colorspace like :
0.712999999523163 0.293000012636185 0.165000006556511 0.829999983310699 0.128000006079674 0.0439999997615814 0.321680009365082 0.337669998407364
to :
Aces Ap1 (cg, cc, cct, proxy).
Any info about how required attributes are chosen would be very helpful.
Thank you.
The text was updated successfully, but these errors were encountered: