/*6.914, Example 4.0 save() and saveFrame() Using save() with one argument (a filename ending with TIFF, TARGA, JPEG, or PNG) will allow you to save the current image into your sketch's folder. (It won't go to the data folder, but rather into the main folder.) The basic syntax is: save(fileNameString); ... which looks like save("myImage.tif"); Use any of the following file extensions: .tif, .tga., .jpg, or .png. .tif is largest and highest-quality; .tga and .png look medium quality and small; .jpg will be very low-quality and small. If you want to save a series of images, use saveFrame instead. This works about the same way, except that you can give #### as places where the numbers can go, so using this: saveFrame("myFrame-####.tif"); will save your frames as: myFrame-0000.tif myFrame-0001.tif etc. If you don't give any arguments to saveFrame, it will save your frames as screen-0000.tif screen-0001.tif etc. */ void setup(){ size(300, 300); frameRate(.5); strokeWeight(10); smooth(); } void draw(){ background(0, 100, 255); for (int i = 0; i < 10; i++){ stroke(random(100,255),0,0); point(random(width), random(height)); } save("mostRecent.png"); // will overwrite every time saveFrame("myFrame-###.tif"); // will save starting with myFrame-000.tif }