I hope you don't mind that I'm CCing oiio-dev with my reply.

This is an interesting question.  Currently, if you try to open a file for 
output and request a number of channels that it can't support, the open() call 
will fail.  That said, it does seem an entirely reasonable operation to want to 
convert, say, an RGBA file to a format that does not support alpha, by copying 
the RGB only.

I'm curious to hear people's opinions on how to address this problem.  I can 
think of several possible strategies:

1. (Logic in the plugins) Change the JPEG (and/or others) output to silently 
and automatically truncate channels if asked to write more channels than the 
format supports, much like how it will force uint8 data (because that's all 
JPEG supports) even if you ask for something else.  Or, we could keep the 
default as it is (fail), but have JPEG support a request by the app to truncate 
channels (via the "open with config" call) and have iconvert and certain other 
apps make that request.

2. (Logic in the app) Leave the drivers alone, but make iconvert and oiiotool 
check the failure messages and, if an open() fails and nchannels > 3, make an 
intelligent guess by trying to open the file a second time with fewer channels, 
and if that succeeds, output that way. 

3. (Logic in the user's head) Add a --channels option to oiiotool that lets you 
explicitly prune or shuffle channels, so you could

        oiiotool my5channelfile.exr --channels R,G,B -o besticando.jpg


Opinions?  None are very hard, I can fix right away, but first I'd like to get 
consensus on which level of the onion ought to have the control of this 
behavior.



On Aug 3, 2012, at 8:16 AM, Adam Wierzchowski wrote:

> Hi,
> seems like iconvert cannot convert multichannel exr files to jpeg format:
> iconvert ERROR: Could not open "p:/1310.Adam-testy.Base/conv/outCh3.jpg" : 
> jpeg does not support 5-channel images
> 
> Is there a way to strip exr to rgb channels and convert it to jpeg anyway?
> 
> regards
> Adam

--
Larry Gritz
[email protected]


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

Reply via email to