Hello,

I've been running into an issue with the OIIO libRaw support and wanted to
see if anyone else had run into the same problem and found a workaround.

The issue
Raw files read and developed by OIIO using libRaw are automatically
brightened.

The potential cause tl;dr
The RawInput::open method doesn't set the 'no_auto_bright' flag
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L130
like dcraw does when using either the '-4' flag or the '-W' flag.
https://github.com/LibRaw/LibRaw/blob/master/samples/dcraw_emu.cpp#L337
https://www.cybercom.net/~dcoffin/dcraw/dcraw.c - line 9963 or 9965

Context
If you use dcraw, or libRaw's dcraw_emu, to convert raw images to Tiff, and
you want to produce linear 16 bit data for your exposures, the '-4' flag is
often used. That is a shorthand for the flags '-6 -W -g 1 1'. '-6' set up
16 bit data processing. '-g 1 1' sets the gammas to 1.0, 1.0. '-W' turns
off dcraw's 'auto_bright' functionality. The last flag is especially
important if you want to merge exposures or otherwise treat your data as a
more exact measurement of the world.

Suggestion
Add the line:
    m_processor.imgdata.params.no_auto_bright = 1;
around line 137 of rawinput.cpp
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L137

Open question
For general OIIO usage, is there a good reason to be able to turn
'auto_bright' on?

Will be testing that out this weekend but figured I'd see if there was an
alternate approach to solving this problem.

Thanks in advance for your help,
HP
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to