ImageInfo
¶
-
class
Draft.
ImageInfo
((object)arg1) → None¶ A class that contains image file properties.
New in version 1.1.
__init__( (object)arg1) -> None
-
compression
¶ A string used to retrieve (on read) and set (on write) the compression of an image. Defaults to ‘default’ which corresponds to the file format default. Valid compression values are: ‘default’, ‘none’, ‘jpeg’, ‘lzw’, ‘rle’, ‘zip’, ‘zips’, ‘piz’, ‘pxr24’, ‘b44’, ‘b44a’, ‘dwaa’ and ‘dwab’.
New in version 1.4.
-
quality
¶ An integer value in the range [0..100] used to retrieve (on read) and set (on write) the quality of an image. Defaults to None which corresponds to the file format default.
New in version 1.4.
-
tileSize
¶ A tuple used to retrieve (on read) and set (on write) the width and height of the tiles in an image. Defaults to None for non-tiled images.
-
timecode
¶ A
Draft.Timecode
object used to retrieve (on read) and set (on write) the timecode associated to an image. Defaults to None.New in version 1.5.
-
Usage:
To determine whether an EXR file is tiled:
imageInfo = Draft.ImageInfo()
image = Draft.Image.ReadFromFile( '//path/to/test.exr', imageInfo=imageInfo )
if imageInfo.tileSize is None:
print "Image is not tiled"
else:
print "Image is tiled"
To write a tiled EXR file:
imageInfo = Draft.ImageInfo()
imageInfo.tileSize = ( 32, 32 )
image = Draft.Image.CreateImage( 1920, 1080 )
image.WriteToFile( '//path/to/out.exr', imageInfo=imageInfo )
To preserve an EXR file’s tile or scanline settings:
imageInfo = Draft.ImageInfo()
image = Draft.Image.ReadFromFile( '//path/to/in.exr', imageInfo=imageInfo )
image.ApplyGamma( 1.8 )
image.WriteToFile( '//path/to/out.exr', imageInfo=imageInfo )
To write a DWAA compressed EXR file with quality set to 75:
imageInfo = Draft.ImageInfo()
imageInfo.compression = 'dwaa'
imageInfo.quality = 75
image = Draft.Image.ReadFromFile( '//path/to/in.exr' )
image.WriteToFile( '//path/to/out.exr', imageInfo=imageInfo )
To embed a timecode in an image:
timecode = Draft.Timecode( "09:10:11:12" )
imageInfo = Draft.ImageInfo()
imageInfo.timecode = timecode
image = Draft.Image.ReadFromFile( '//path/to/in.exr' )
image.WriteToFile( '//path/to/out.exr', imageInfo=imageInfo )