Thread: Help required to read PPM image files

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    1

    Help required to read PPM image files

    Hi all, I am a newbie in c programing.Can anyone please tell me how to read a ppm image file in c and obtain the rgb data contained in it in a mXnX3 dimensional array. For example, if the image has dimensions 128 by 128, then my array shold be of type arr[128][128][3]. Thanks in advance.

  2. #2
    Registered User
    Join Date
    Jan 2007
    Location
    Euless, TX
    Posts
    144

    Smile

    I suggest Googling "PPM" and check out the format of the file. Once you know that, you should be able to read the pixel data quite easily.

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    http://www.wotsit.org is great for file format information
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. saving bmp image files
    By aniramg69 in forum C Programming
    Replies: 10
    Last Post: 12-30-2008, 10:08 AM
  2. "sorting news" assignment
    By prljavibluzer in forum C Programming
    Replies: 7
    Last Post: 02-06-2008, 06:45 AM
  3. Prob with padding in BMP image files
    By tin in forum Game Programming
    Replies: 2
    Last Post: 01-09-2006, 08:23 AM
  4. How to read digits from an image?
    By loobian in forum C# Programming
    Replies: 1
    Last Post: 07-15-2005, 11:09 AM
  5. BCB5 Required Files
    By marf in forum Windows Programming
    Replies: 1
    Last Post: 02-27-2003, 07:23 PM