
Image Editor
The Portable Pixel Map (PPM) format is a text-based format
that can be used to create simple color images such as this
CSC116 block letter/number representation:
PPM format may also be used to depict quite complex images
such as the piece of cake shown below, which comes from the
"nifty assignment" (-
image-editor/) on which this project is based in part.
Sample PPM File
A PPM file may be created and manipulated using a text
editor and viewed with the image viewer available on the
Linux computers in the classroom and labs. To view PPM
images on a Windows computer, you may install and use
Irfanview. On a Mac, you can use TextEdit to edit a PPM file,
and Aquamacs to view it.
The first line contains P3, the file format type. For this
project, you may assume that it will always be P3.
The second line contains the number of columns followed by
the number of rows used to represent the image. For this
project, you may assume that the columns in each row will be
contained in a single line of the PPM file, that is, a row will
NOT extend over multiple lines of the file.
The third line contains the maximum color value. For this
project, you may assume it will always be 255.
The remaining lines provide the colors used to display each
pixel in the image. The color of each pixel is given by a
sequence of 3 numbers, which determine how much red,

green, and blue are present. This is known as an RGB (Red,
Green, Blue) value. A value of 0 means that none of a
particular color is present, while a value of 255 means that
the maximum amount of the color is present. The first three
numbers on the fourth line are 0 0 0, the color of the first
pixel, which is black (no Red, Green, or Blue). The fifth
sequence of three numbers on the sixth line is255 0 0, which
represents red (maximum amount of Red, no Green, and no
Blue). See pp 206 - 207 of the textbook for more information


You've reached the end of your free preview.
Want to read all 7 pages?
- Winter '20
- Computer file formats, Filename extension, Computer file, File format, Text editor