I just getting into writing stuff using OpenImageIO. I my experiment, I'm trying to extract a few select sub images from an exr file and write them into another one. But when I try the following examples from the documentation and I keep getting an error.
#!/usr/bin/env python
import OpenImageIO as oiio
filename = "a.exr"
final = "b.exr"
input = oiio.ImageInput.open (filename)
spec = input.spec ()
pixels = input.read_image ()
input.close ()
output = oiio.ImageOutput.create (final)
if output.supports("multiimage") :
output.open(final, spec)
output.write_image(pixels)
output.close ()
When I try this, I get the following error :
ArgumentError: Python argument types in
ImageOutput.open(ImageOutput, str, ImageSpec)
did not match C++ signature:
open(PyOpenImageIO::ImageOutputWrap {lvalue}, std::string, boost::python::tuple {lvalue})
open(PyOpenImageIO::ImageOutputWrap {lvalue}, std::string, OpenImageIO::v1_6::ImageSpec, OpenImageIO::v1_6::ImageOutput::OpenMode)
I was wondering if anyone can please point out what I'm doing wrong here? Any help is very much appreciated.
Thanks a lot