forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPImage_save.xml
More file actions
49 lines (38 loc) · 1.69 KB
/
PImage_save.xml
File metadata and controls
49 lines (38 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>save()</name>
<category>PImage</category>
<subcategory>Method</subcategory>
<type></type>
<example>
<noimage />
<code><![CDATA[
apples = loadImage("apples.jpg")
apples.save("outputImage.jpg")
]]></code>
</example>
<example>
<noimage />
<code><![CDATA[
size(100, 100)
apples = loadImage("apples.jpg")
newImage = createImage(100, 100, RGB)
newImage = apples.get()
newImage.save("outputImage.jpg")
]]></code>
</example>
<description><![CDATA[
Saves the image into a file. Images are saved in TIFF, TARGA, JPEG, and PNG format depending on the extension within the <b>filename</b> parameter. For example, "image.tif" will have a TIFF image and "image.png" will save a PNG image. If no extension is included in the filename, the image will save in TIFF format and <b>.tif</b> 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. It is not possible to use <b>save()</b> while running the program in a web browser.<br /><br />To save an image created within the code, rather than through loading, it's necessary to make the image with the <b>createImage()</b> function so it is aware of the location of the program and can therefore save the file to the right place. See the <b>createImage()</b> reference for more information.
]]></description>
<syntax>
<c>pimg</c>.save(<c>filename</c>)
</syntax>
<parameter>
<label>pimg</label>
<description><![CDATA[PImage: any object of type PImage]]></description>
</parameter>
<parameter>
<label>filename</label>
<description><![CDATA[String: a sequence of letters and numbers]]></description>
</parameter>
</root>