This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name

save()

Examples
line(20, 20, 80, 80);
// Saves a TIFF file named "diagonal.tif"
save("diagonal.tif");
// Saves a TARGA file named "cross.tga"
line(80, 20, 20, 80);
save("cross.tga");
Description Saves an image from the display window. Append a file extension to the name of the file, to indicate the file format to be used: either TIFF (.tif), TARGA (.tga), JPEG (.jpg), or PNG (.png). If no extension is included in the filename, the image will save in TIFF format and .tif will be added to the name. These files are saved to the sketch's folder, which may be opened by selecting "Show sketch folder" from the "Sketch" menu. Alternatively, the files can be saved to any location on the computer by using an absolute path (something that starts with / on Unix and Linux, or a drive letter on Windows).

All images saved from the main drawing window will be opaque. To save images without a background, use createGraphics().
Syntax
save(filename)
Parameters
filename String: any sequence of letters and numbers
Returnsvoid
RelatedsaveFrame()
createGraphics()
Updated on May 19, 2014 05:29:59pm PDT

Creative Commons License