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 = "
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("
ImageIO.write((RenderedImage) bitmap.getImage(), "jpg", grayFile);
}
|