OpenImageIO/oiio — pull request #602 by lgritz (2013-05-20 23:38:43+00:00)
Title: oiiotool -d enhancement: -d CHAN=TYPE sets for just one channel.

Clarification of oiiotool -d command:

As before, -d TYPE sets the data type for subsequent image output, for all channels.

New: -d CHAN=TYPE overrides the data type for a particular named channel. This also lets oiiotool, for the first time, easily specify that its output should have different per-channel data types (if the output file format supports it).

Example: if you have an rgbaz file, all float channels, you can convert it to a file where rgba are half and z is float:

oiiotool rgbaz.exr -d half -d Z=float -o rgbaz2.exr

(Note that OpenEXR is one of the few formats that can support this.)

Along the way, also found and fixed an OpenEXR bug: was botching ordering of per-channel data formats because of the channel order scrambling that happens when reading OpenEXR files.

Fixes #600.