Programming 'it' |
Functions to read and save images. The governing philosophy is to retain all the precision of the file format during loading, and to choose a format capable of representing in-memory images during save operations.
The file format is automatically determined, and the returned Image has a precision large enough to represent the contents of the file. Practically, this means that images with 8 bits per channel (including color-mapped images) are read in as Fractional images, and all others are read in as Float images.
Most popular file formats are recognized and read in correctly. The following file formats can be read:
fileName := "image.tif" image := IceImage With(fileName) |
Save image to file using specified format. Default always saves the image out in the TIFF format with appropriate precision. This function returns an integer: 0 for success, -1 for failure.
Note: It is worth mentioning that dithering is notdone automatically while saving to a lower-precision format.
fileName := "image.tif" format := IceOutputType TiffFloat result := image Save(fileName, format) |
The Jpeg format looks at the image's meta-data dictionary to determine the "quality" factor of the output image. The "quality" of a JPEG image is a number between 1 and 100.
fileName := "image.jpg" format := IceOutputType Jpeg image SetMetaDataItem("JPEG_QUALITY", 50) result := image Save(fileName, format) |
Pixar Animation Studios
|