What program to download to read a pgm file






















Because you cannot display it in the terminal -- you have to be running a GUI of some type. How you store the image depends on how you intend to display it. The other possibility is the create your own image format and draw the image yourself pixel by pixel to the output device. Either way, you'll have to spend some time learning how to do it Good luck.

And about this, i just want to make a program to modify the pixels of the file There are two versions of getline. A PGM file is a grayscale image file saved in the portable gray map PGM format and encoded with one or two bytes 8 or 16 bits per pixel. It contains header information and a grid of numbers that represent different shades of gray from black 0 to white up to 65, PGM files include a header that defines the PGM format type "P2" for text or "P5" for binary , image width and height, and the maximum number of shades.

The PGM format is one of several image formats defined by the Netpbm project, which is an open source package of graphics programs. Other formats include the portable bitmap. PBM format and portable pixmap. Format unsupported. Improve this question. Perhaps your PGM is not correct. It should be a simple ASCII file so open it with a code editor of choice and verify against the specifications. Note that they say you shouldn't cast the result of malloc in C. I opened every pgm image I have and all seems to be right.

Add a comment. Active Oldest Votes. Improve this answer. Community Bot 1 1 1 silver badge. Yes I did. Anyway thank you very much, the libraries you suggested me were very useful! Sign up or log in Sign up using Google.

Sign up using Facebook.



0コメント

  • 1000 / 1000