@@ -0,0 +1,833 @@
+package org.stuygfx;%0A%0Aimport static org.stuygfx.CONSTANTS.MAX_COLOR_VALUE;%0Aimport static org.stuygfx.CONSTANTS.PPM_HEADER;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0A%0Aimport org.stuygfx.graphics.Image;%0Aimport org.stuygfx.graphics.Pixel;%0A%0Apublic class PPMGenerator %7B%0A%0A    public static void createPPM(String filename, Image img) throws IOException %7B%0A        PrintWriter fout = new PrintWriter(new File(filename));%0A        fout.println(PPM_HEADER);%0A        fout.printf(%22%25d %25d %25d%5Cn%22, img.XRES, img.YRES, MAX_COLOR_VALUE);%0A        for (int y = 0; y %3C img.YRES; y++) %7B%0A            for (int x = 0; x %3C img.XRES; x++) %7B%0A                Pixel tmp = img.canvas%5By%5D%5Bx%5D;%0A                fout.printf(%22%25d %25d %25d %22, tmp.r, tmp.g, tmp.b);%0A            %7D%0A        %7D%0A        fout.close();%0A        fout = null;%0A    %7D%0A%0A%7D%0A

Add writeout function