Writes an image to the specified filename or destination.
Requires Extension: Image extension
ImageWrite( image=any, destination=string, quality=number, overwrite=boolean, noMetaData=boolean );
Argument |
Description |
Default |
image
any,
required
|
The image on which this operation is performed.
Alias:
name
|
|
destination
string,
optional
|
The path to write the file.
If you create the image with the ImageNew function or another operation where you do not specify the filename, specify the destination parameter.
The file format is derived from the extension of the filename. The default value for this parameter is the filename of the original image source.
|
|
quality
number,
optional
|
Defines the JPEG quality used to encode the image. This parameter applies only to destination files with an extension of JPG or JPEG. Valid values are fractions that range from 0 through 1 (the lower the number, the lower the quality). The default value is 0.75.
|
0.75
|
overwrite
boolean,
optional
|
If set to true (default), overwrites the destination file.
|
true
|
noMetaData
boolean,
optional
|
if true the meta data from the source file are ignored.
|
false
|
Examples
newImg = imageNew("",200,200,"rgb","red");
newImg.write("picture.png");
See also