Result = SaveImage(#Image, Filename$ [, ImagePlugin [, Flags [, Depth]]])
Saves the specified image to disk.


#Image The image to save.
Filename$ The file to save to. If the filename does not include a full path, it is interpreted relative to the current directory.
ImagePlugin (optional) The format to save the image in. This can be one of the following values:
  #PB_ImagePlugin_BMP      : Save the image in BMP (default)
  #PB_ImagePlugin_JPEG     : Save the image in JPEG (UseJPEGImageEncoder() has to be used)
  #PB_ImagePlugin_JPEG2000 : Save the image in JPEG2000 (UseJPEG2000ImageEncoder() has to be used)
  #PB_ImagePlugin_PNG      : Save the image in PNG (UsePNGImageEncoder() has to be used)
Flags (optional) Optional parameters for the image plug-in. For now, only the quality setting is supported: a number from 0 (worse quality) to 10 (maximum quality). Only the JPEG and JPEG 2000 plugins currently support it (default quality is set to '7' if no flags are specified).

When an image is saved using palletized depth (1, 4 or 8), the following flag is available for combination:
  #PB_Image_FloydSteinberg: Apply a Floyd-Steinberg dithering.
Depth (optional) The depth in which to save the image. Valid values are 1, 4, 8, 24 and 32. The default value is the original image depth. For now, only BMP and PNG encoders support palletized image format (1, 4 or 8-bit).

Return value

Returns nonzero if the operation succeeded and zero if it failed.

See Also

ImageDepth(), ImagePlugin library

Supported OS


<- ResizeImage() - Image Index - SetImageFrame() ->