[Sorry if this is a bit off-topic for the list; is there a "user
questions" list?]

First, thank you for this library!  It's vastly nicer than every other
generic image library I've ever encountered -- every other such library
I've found has been basically unusable (e.g. by requiring image I/O be
done on entire images at once, etc).  OIIO is the first one that's
good enough to actually use!

Second, a question: Is there a way I can tell OpenImageIO "whatever
the output format is, use the 'normal' data-type for that format."?

Currently, all my internal image data is floats.  The OIIO library
makes it simple to handle this: I can just use TypeDesc::FLOAT to
ImageOutput::write_scanline, and it takes care of any conversion
necessary.  However, if I specify TypeDesc::FLOAT when _opening_ the
output image, OIIO will basically use the deepest data-type it can for
the output format, and often this isn't actually what I want.

Really what I want is to use the "normal" data-type for the output
format; e.g. for an EXR file, I'd like it to use HALF (which is almost
always good enough, is what's "expected", and of course saves a lot of
disk space).  For PNG files, I'd actually like it to use 8-bits by
default (OIIO chooses 16-bits for PNG); this is maybe more
controversial, but again, the idea is that if the user specified a PNG
file, they're probably expecting it.  [Of course it would be good to
have a way for the user to override such defaults and choose a deeper
data-type when he really wants that... but that's an issue for my
program, not OIIO.]

I can do this, I suppose, by making my own mapping of format names to
desired output data-types, but this seems obviously fragile and
arguably something I shouldn't have to do when using a generic image
I/O library.

Is there some feature in OIIO that would let me easily do this...?  Or
maybe some future extension?

[I'm not entirely sure what exactly the right thing to do is in every
circumstance, but ... the idea is that when the user specifies a
filename, the default output should roughly match what he _expects_,
and this has as much to do with convention as it does with actual
capability.]

Thanks,

-miles

-- 
History, n. An account mostly false, of events mostly unimportant, which are
brought about by rulers mostly knaves, and soldiers mostly fools.

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

Reply via email to