Discussion:
[Oiio-dev] Setting colorspace options when reading RAW files in oiiotool
Alex Fry
2016-09-11 02:33:32 UTC
Permalink
Hey guys

I'm playing around a little bit with converting RAW files to ACES EXRs.

Ideally id like to be able to do this entirely with oiiotool (or via
openimageio within python)

Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4
-o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool

Basically I'm treating dcraw's various input camera matrices as part 1 of a
rough and ready IDT.

Is there a way to tell libraw within olio to debayer to straight linear XYZ?

Thanks
Alex
Fabrice Faivre
2016-09-11 18:59:10 UTC
Permalink
Hello,

Following Alex Fry and Haarm-Pieter Duiker requests, I would also be extremely interested to have the full set of dcraw / libraw options accessible within oiiotool !
I need to process RAW still frames with autobright off, custom camera matrices and XYZ colorspace...

FF.
Post by Alex Fry
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4 -o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
Haarm-Pieter Duiker
2016-09-12 06:40:02 UTC
Permalink
Hey Alex,

I've been looking at this code as well recently. If you check out the
RawInput::open method here:
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139
it looks like a metadata field named "raw:ColorSpace" on the secondary
'config' ImageSpec will drive the colorspace that libRaw will use when
delivering the raw data.

If you figure out how to set that up on through Python, it would be great
to see a working example.

HP
Post by Alex Fry
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via
openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4
-o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of
a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
Larry Gritz
2016-09-12 16:58:15 UTC
Permalink
Python: it depends on the interface you are using to read the files -- raw ImageInput, or using ImageBuf?
Post by Haarm-Pieter Duiker
Hey Alex,
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139 <https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139>
it looks like a metadata field named "raw:ColorSpace" on the secondary 'config' ImageSpec will drive the colorspace that libRaw will use when delivering the raw data.
If you figure out how to set that up on through Python, it would be great to see a working example.
HP
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4 -o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
***@larrygritz.com
Alex Fry
2016-09-12 20:50:38 UTC
Permalink
Right now I'm just using oiiotool via the command line. But I'm fine going
down the python route if that's what's necessary.

So Larry, you think it is possible with the current code?

If not, can oiiotool take input from stdin coming from dcraw?

-Alex
Post by Larry Gritz
Python: it depends on the interface you are using to read the files -- raw
ImageInput, or using ImageBuf?
Hey Alex,
I've been looking at this code as well recently. If you check out the
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139
it looks like a metadata field named "raw:ColorSpace" on the secondary
'config' ImageSpec will drive the colorspace that libRaw will use when
delivering the raw data.
If you figure out how to set that up on through Python, it would be great
to see a working example.
HP
Post by Alex Fry
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via
openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4
-o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of
a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
Haarm-Pieter Duiker
2016-09-13 06:09:49 UTC
Permalink
I was able to use a custom ImageSpec with ImageInput's open method to set
the gamut. If you need to use any of the ImageBuf algorithms, you can
transfer pixel data to an ImageBuf. If not, you could just write the data
out.

Example code here:
https://github.com/hpd/general/blob/master/hdr/python/mkhdr.py#L104

HP
Post by Alex Fry
Right now I'm just using oiiotool via the command line. But I'm fine going
down the python route if that's what's necessary.
So Larry, you think it is possible with the current code?
If not, can oiiotool take input from stdin coming from dcraw?
-Alex
Post by Larry Gritz
Python: it depends on the interface you are using to read the files --
raw ImageInput, or using ImageBuf?
On Sep 11, 2016, at 11:40 PM, Haarm-Pieter Duiker <
Hey Alex,
I've been looking at this code as well recently. If you check out the
https://github.com/OpenImageIO/oiio/blob/master/
src/raw.imageio/rawinput.cpp#L139
it looks like a metadata field named "raw:ColorSpace" on the secondary
'config' ImageSpec will drive the colorspace that libRaw will use when
delivering the raw data.
If you figure out how to set that up on through Python, it would be great
to see a working example.
HP
Post by Alex Fry
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via
openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw
-4 -o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1
of a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
Larry Gritz
2016-09-15 05:11:17 UTC
Permalink
OK, so it looks like you should be able to get the data in XYZ space if you do:

oiiotool --iconfig raw:ColorSpace XYZ therawfile ...
Right now I'm just using oiiotool via the command line. But I'm fine going down the python route if that's what's necessary.
So Larry, you think it is possible with the current code?
If not, can oiiotool take input from stdin coming from dcraw?
-Alex
Python: it depends on the interface you are using to read the files -- raw ImageInput, or using ImageBuf?
Post by Haarm-Pieter Duiker
Hey Alex,
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139 <https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139>
it looks like a metadata field named "raw:ColorSpace" on the secondary 'config' ImageSpec will drive the colorspace that libRaw will use when delivering the raw data.
If you figure out how to set that up on through Python, it would be great to see a working example.
HP
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4 -o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
--
Larry Gritz
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
***@larrygritz.com
Larry Gritz
2016-09-15 05:17:45 UTC
Permalink
On command line for oiiotool, you can set these configuration switches with --iconfig, which is a lot like --attrib except that it is setting up one of those configuration ImageSpec's for the next file that's input. Like this:

oiiotool --iconfig raw:ColorSpace XYZ myrawfile.cr2

From Python, the way you do this is like:

cfg = oiio.ImageSpec()
cfg.attribute ("raw:ColorSpace", "XYZ")
buf = oiio.ImageBuf ()
buf.reset ("myrawfile.cr2", config=cfg)
# Sorry, I know that's slightly awkward, but there's not currently a one-line way to
# create a new ImageBuf and set up the config in one step. But from this point on,
# you can just carry on with the rest of your ImageBuf operations, as usual...
Post by Haarm-Pieter Duiker
Hey Alex,
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139 <https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139>
it looks like a metadata field named "raw:ColorSpace" on the secondary 'config' ImageSpec will drive the colorspace that libRaw will use when delivering the raw data.
If you figure out how to set that up on through Python, it would be great to see a working example.
HP
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4 -o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
***@larrygritz.com
Larry Gritz
2016-09-15 05:20:27 UTC
Permalink
Sorry, just for completeness, the C++ version:

ImageSpec cfg;
cfg.attribute ("raw:ColorSpace", "XYZ);
ImageBuf buf ("myrawfile.cr2", 0 /*subimage*/, 0 /*miplevel*/,
NULL /*imagecache*/, &cfg /*config*/);
Post by Larry Gritz
oiiotool --iconfig raw:ColorSpace XYZ myrawfile.cr2
cfg = oiio.ImageSpec()
cfg.attribute ("raw:ColorSpace", "XYZ")
buf = oiio.ImageBuf ()
buf.reset ("myrawfile.cr2", config=cfg)
# Sorry, I know that's slightly awkward, but there's not currently a one-line way to
# create a new ImageBuf and set up the config in one step. But from this point on,
# you can just carry on with the rest of your ImageBuf operations, as usual...
Post by Haarm-Pieter Duiker
Hey Alex,
https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139 <https://github.com/OpenImageIO/oiio/blob/master/src/raw.imageio/rawinput.cpp#L139>
it looks like a metadata field named "raw:ColorSpace" on the secondary 'config' ImageSpec will drive the colorspace that libRaw will use when delivering the raw data.
If you figure out how to set that up on through Python, it would be great to see a working example.
HP
Hey guys
I'm playing around a little bit with converting RAW files to ACES EXRs.
Ideally id like to be able to do this entirely with oiiotool (or via openimageio within python)
Right now I use dcraw to go to a 16bit linear tiff in XYZ space (dcraw -4 -o 5 -T ), then flip from XYZ to ACES using Nuke or oiiotool
Basically I'm treating dcraw's various input camera matrices as part 1 of a rough and ready IDT.
Is there a way to tell libraw within olio to debayer to straight linear XYZ?
Thanks
Alex
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org <http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org>
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
_______________________________________________
Oiio-dev mailing list
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
***@larrygritz.com

Loading...