You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing images with ImageOutput or ImageBuf, it's possible to specify the target pixel type as a TypeDesc (respectively in the newspec (C++)/spec (Python) parameter for ImageOutput.open , or the dtype parameter for ImageBuf.write).
However, the final selected type ultimately depends on the plugin, as some image formats may be incompatible with the user-specified type.
When this mismatch happens, the plugin silently changes the user selected type and writes the image in its own preferred type, which should best preserve precision.
However, this behavior might be surprising to some users expecting no change of pixel type, or at least no precision loss.
Could there be a way to write the images in a "strict" mode, where OpenImageIO would return an error in these cases instead of changing the target type ?
Or maybe a way to manually check the valid pixel types for the selected plugin before attempting to write the image ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
When writing images with
ImageOutputorImageBuf, it's possible to specify the target pixel type as aTypeDesc(respectively in thenewspec(C++)/spec(Python) parameter forImageOutput.open, or thedtypeparameter forImageBuf.write).However, the final selected type ultimately depends on the plugin, as some image formats may be incompatible with the user-specified type.
When this mismatch happens, the plugin silently changes the user selected type and writes the image in its own preferred type, which should best preserve precision.
However, this behavior might be surprising to some users expecting no change of pixel type, or at least no precision loss.
Could there be a way to write the images in a "strict" mode, where OpenImageIO would return an error in these cases instead of changing the target type ?
Or maybe a way to manually check the valid pixel types for the selected plugin before attempting to write the image ?
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions