Header comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fluffybunny87
    New Member
    • Nov 2006
    • 8

    #1

    Header comments

    Hi, I am writing a java program that will read an image in, convert it to greyscale, and then shoot it back out into a new file. The only problem is, I can't figure out how to make my program skip over header comments in the original image, any ideas? Thanks for any help!
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by fluffybunny87
    Hi, I am writing a java program that will read an image in, convert it to greyscale, and then shoot it back out into a new file. The only problem is, I can't figure out how to make my program skip over header comments in the original image, any ideas? Thanks for any help!
    What headers are you talking about? Can you explain how you are reading in the image?

    Comment

    • fluffybunny87
      New Member
      • Nov 2006
      • 8

      #3
      I have to write a program in Java to read a PPM file from standard in and output put it in grayscale using PGM format to standard out. To test the program, I redirect a PPM file to standard in, and redirect to output to a file e.g. java RGBtoGray < in.ppm > out.pgm.

      In the code of a picture, there are sometimes comments or other things that don't need to be read to output the image, I need to know how to skip over the unwanted characters and still just print out the image.

      Originally posted by r035198x
      What headers are you talking about? Can you explain how you are reading in the image?

      Comment

      Working...