Bitmap/Read a PPM file: Difference between revisions

New post
(New post)
Line 1,827:
 
public static void main(String[] aArgs) throws IOException {
// Using the file created in the Bitmap task
String filePath = "C:/Users/psnow/Desktop/output.ppm";
reader = new BufferedInputStream( new FileInputStream(filePath) );
Line 1,872 ⟶ 1,873:
// Convert to gray scale and save to a file
bitmap.convertToGrayscale();
File grayFile = new File("C:/Users/psnow/Desktop/outputGray.jpg");
ImageIO.write((RenderedImage) bitmap.getImage(), "jpg", grayFile);
}
884

edits