Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Saving an image file (PGM format)

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Saving an image file (PGM format)

    Hello,

    I've written a program that loads a .pgm file, processes it through a median filter, and displays it via GUI.

    I'm trying to write a saveImage() method that will save the file with a "_processed" tag to the end of the original image name. The original and processed images each have their pixels in a 2-dimensional array.

    Can anybody direct me to a class and method to use to write this .pgm file to the same directory?

    Thanks a ton.


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Saving an image file (PGM format)

    Which bit do you need help with? All you need to do it write your array to a file really. Along with a couple of other predetermined bits and some white space. And then a "#_processed" tag. You can write your own code to do this in a matter of seconds.

    Chris

  3. The Following User Says Thank You to Freaky Chris For This Useful Post:

    Mickey2315 (September 12th, 2009)

  4. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Saving an image file (PGM format)

    Thank you, I figured it out. I specialize in making programming harder than it actually is.

  5. #4
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: Saving an image file (PGM format)

    Hehe .

    If thats everything could you mark this as solved.

    Thanks,
    Chris

Similar Threads

  1. How Convert a Byte array to a image format
    By perlWhite in forum Algorithms & Recursion
    Replies: 7
    Last Post: February 19th, 2011, 03:16 PM
  2. Java program to format a double value to 2 decimal places
    By JavaPF in forum Java Programming Tutorials
    Replies: 3
    Last Post: December 4th, 2010, 04:08 PM
  3. [SOLVED] Saving A File?
    By MysticDeath in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: August 1st, 2009, 11:56 AM
  4. Replies: 2
    Last Post: June 26th, 2009, 11:08 AM
  5. How to save statistics of a game in a binary file instead of txt file?
    By FretDancer69 in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: June 19th, 2009, 05:05 AM