How ot know if an EXR is already in ACEScg?

I’m making a script to convert all my HDRI maps to ACEScg. Calling OCIO command line tool like this;

ocioconvert sky.exr linear sky.exr acescg

But I’m worried that I might “double convert” an EXR. If it possible to check if an EXR file is in linear sRGB or ACEScg?

In theory EXRs contain metadata which specifies the primaries. However I think it would be dangerous to rely on this for automatic conversion.

This is one reason why the ACES image container is tightly specified, and the flag should only be set if the image data in the EXR is ACES2065-1. That way there should be no ambiguity. However it is not uncommon for people to mistakenly set the flag when writing ACEScg image data. So even this cannnot be relied upon.

Hi @raincolee ,

I always manually check the colorchecker that is hopefully present in the HDRI and place an overlay reference colorcheker in Nuke on top of it. Then it’s easy to spot a mismatch of colorspaces.

And it makes sense that all HDRI files are properly named:
sky_lin_sRGB.exr —> sky_acescg.exr.