Color space transformation issue (first-time user)


silverlann@...
 

Hello all!

I'm using a renderer which outputs images in linear color space with HDR colors (16 bit), and I want to use OCIO to apply tone mapping +gamma correction to these images to convert them to sRGB space, but I'm somewhat uncertain on how to approach this. There are some usage examples on https://opencolorio.org/developers/usage_examples.html , however they appear to be outdated, as some of the functions used in them (like "getDefaultDisplayDeviceName" or "getDisplayColorSpaceName") do not exist anywhere in the code base.
I ended up using the "ocioconvert" app shipped with the repository as a base instead, but I'm still not entirely sure on how to go about it.
For my test program I've loaded the "spi-vfx" configuration (https://opencolorio.org/configurations/spi_vfx.html) and tried setting up the color space transformation for my image like so:
OCIO::DisplayViewTransformRcPtr t = OCIO::DisplayViewTransform::Create();
t->setSrc("lnh");
t->setDisplay("sRGB");
t->setView("Film");
processor = config->getProcessor(t);
The input color space is "lnh", since my input colors are 16 Bit HDR colors in linear color space.
"display" and "view" are set to "sRGB"/"Film", which, as I understand it, should transform the colors for output on a sRGB display.

The program runs without any errors, but after the transformation the output image mostly just looks very milky: https://i.imgur.com/AL861bG.png
I've had similar results with other configurations. My understanding of color management is still somewhat limited, so I'm not sure what I'm doing wrong, any guidance would be much appreciated!

Here's my test program code with the input image and executable (Windows), if needed: https://www.dropbox.com/s/u29bcl5dbui6xam/ocio_transform_test.zip?dl=1

Thank you!

Join ocio-dev@lists.aswf.io to automatically receive all group messages.