You're half way there -- this python script splits all the non-RGB channels out 
into separate JPG files.

It's easy to convert your jpegs to an animated GIF from the command line:

    oiiotool *.jpg -siappendall --attrib FramesPerSecond 1.0 -o anim.gif

Doing it from Python is possible (given a very recently posted fix), but 
frankly is unnecessarily complicated compared to the above single command.



> On Jul 17, 2020, at 1:30 PM, Jerome Raim <[email protected]> wrote:
> 
> Hello all,
> I'm writing a script to help operators inspect all available channels that 
> aren't RGB in an EXR. I'd like to create a 1fps GIF that shows all non-RGB 
> channels.
> 
> I am able to extract each channel and save it as JPG, but not finding the 
> proper syntax to save it as an animated GIF.
> 
> What I have so far:
> 
> import OpenImageIO as oiio
> from OpenImageIO import ImageInput, ImageOutput
> from OpenImageIO import ImageBuf, ImageSpec, ImageBufAlgo, ROI
> 
> input_path = 'vfx.exr'
>  
> 
> img = oiio.ImageBuf(input_path)
> 
> for ch in [c for c in spec.channelnames if not c in ['R', 'G', 'B']]:
>     ch_img = ImageBufAlgo.channels(img, (ch,ch,ch), newchannelnames=("R", 
> "G", "B"))
>     ch_img = ImageBufAlgo.fit(ch_img, roi=ROI(0,640,0,480,0,1,0,3))
>     ImageBufAlgo.render_text(ch_img, x=0, y=100, text=ch, textcolor=(1,1,1,1))
>     
>     ch_img.write("{}.jpg".format(ch) ## 
> 
> 
> Thanks in advance for your help.
> 
> Best,
> Jerome
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
[email protected]




_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to