Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Image IO » SaveImage

SaveImage


Saves an image to a file.

Name Type Description
inImage Image An image to be saved
inImageFileFormat ImageFileFormat* If Nil the format will be chosen on the basis of extension
inFile File Path to a file
inIgnoreErrors Bool Switches to re-trying and canceling in case of errors (e.g. when the disk is full)

Only the following inImage pixel formats are supported: uint8, uint16

Description

The operation saves an image to file encoded in one of the standard image file formats. Currently the filter supports the following formats:

  • BMP (*.bmp)
  • JPEG (*.jpg, *jpeg)
  • PNG (*.png),
  • TIFF (*.tif, *.tiff).

Because of the limitations of the standard image formats, the filter is capable of saving three-channel images of UInt8 pixel type for all formats, and UInt16 for supported formats only (PNG, TIFF). To alter the format of an image one can use the filters contained in the Image Conversions category.

The inImageFileFormat input can be used to explicitly select the file format to be used. When inImageFileFormat is set to Auto the recognition of the desired image file format is based on the extension of the file being written, so it is essential that the extension is present and accurate.

If the selected file does not exist, it will be created on filter execution. If the selected file does exist, it will be overwritten.

It is also possible to save images using the general SaveObject filter, which uses internal AVS data format to store any data, that can be later loaded using corresponding LoadObject filter.

Examples

Description of usage of this filter can be found in examples and tutorial: Calibration with Chessboard , Calibration with Chessboard (Advanced), HMI Grab Single Image, HMI Recorder.

Errors

This filter can throw an exception to report error. Read how to deal with errors here: Error Handling

Error type Description
DomainError Requested format is not supported in SaveImage.

Complexity Level

This filter is available on Basic Complexity Level.

See Also