[FEATURE REQUEST] oiiotool thumbnail extraction
Not sure how this oversight happened, but there currently not an oiiotool command that extracts a thumbnail from an image. That would be handy.
For that matter, oiiotool also doesn't make it easy to create or add a thumbnail and save the resulting image. That is trickier, though, requires a bit more design maybe.
Some possible design ideas (not necessarily mutually exclusive):
-
A separate command to extract thumbnail from the top image that already has been loaded:
oiiotool input.exr --thumbnail_get -o thumb.exrQuestions: Should it push the thumbnail to the top of stack as a separate image? Or should it replace the top image with its thumbnail? What happens if there is no thumbnail -- should that be an error, or return the full-res image, or auto-generate a reduced-resolution copy, or return an essentially blank tiny image? Maybe optional modifiers to --thumbnail_get can select among these options. -
Augment the
-iread command with a command to get the thumbnail rather than the main image:oiiotool -i:get_thumbnail=1 input.exr -o thumb.exr -
Generate a thumbnail of an arbitrary image (presumably prior to a write):
oiiotool input.exr ...commands... --thumbnail_generate -o out_with_thumb.exr
What is a thumbnail in this context? some exrs have a smaller version of the image embedded as sub image? can't you just do the same thing with --resize?
Lots of image formats allow storing a low rez image in the header that can be used for quick preview without reading the full-res image and resizing it. The OIIO APIs actually allow you to retrieve that preview image (if it exists), but curiously, we never exposed that via oiiotool in a way that would let you extract it and treat it as a real image.