Well that sure is weird! Usually, both the python bindings and the oiiotool operation are pretty thin wrappers around the corresponding ImageBufAlgo function which is doing almost all the work. A big perf difference is not expected.
Can I assume that this is reproducible by any 70 channel image? Like I can just use oiiotool to generate a black image and see a big speed disparity like this? Or is it in any way specific to the particular image? Wednesdays are pretty packed, but I'l try to take a look at this today if I can. > On Nov 10, 2021, at 4:08 AM, Daniel Flehner Heen <flehnerhee...@gmail.com> > wrote: > > Hi! > > I'm attempting to extract only the RGBA channels of an EXR with 70+ channels. > > Using: > oiiotool -i:ch=R,G,B,A /path/to/gigantic.exr -o manageable.exr > takes about 8 seconds. > > In python (2.7 !caugh..): > buf = oiio.ImageBuf('/path/to/gigantic.exr') > obuf = oiio.ImageBufAlgo.channels(buf, ('R', 'G', 'B', 'A')) > obuf.write('manageable.exr') > takes 4+ minutes > > I tried only extracting one channel and it took the exact amount of time. I > expect a performance hit using python but this seems a bit off. I suspect the > python bindings are reading all the channels even though I'm asking for a > specific few. > I might of course be going about this completely wrong, in which case a > pointer in the right direction would be highly appreciated :) > > Straight read and write of the same file is done quickly. > > Thanks! > > -- > -Daniel > _______________________________________________ > Oiio-dev mailing list > Oiio-dev@lists.openimageio.org > http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org -- Larry Gritz l...@larrygritz.com
_______________________________________________ Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org