Full Name |
PPM (Portable Pixmap File Format) |
Format ID |
ImGearFormats.PBM (See the Note below) |
File Extension(s) |
*.ppm |
Data Type |
Raster Image |
Data Encoding |
Binary |
Multi-Page Support |
No |
Alpha Channel Support |
No |
Metadata Update Support |
No |
ImageGear Platforms Support |
WIN32, WIN64, Unix, Unix64, .NET, .NET64, MAC |
ImageGear supports PPM file format via its PBM format filter. Use
ImGearFormats.PBM to save images to PPM format.
ImageGear Supported Versions
October 1991 - last release
ImageGear Supported Features
- IGFilterFormatFlags.DETECTSUPPORT - autodetection
- IGFilterFormatFlags.PAGEREADSUPPORT - single page file reading
- IGFilterFormatFlags.PAGEINSERTSUPPORT - single-page file writing
ImageGear Read Support
- ImGearCompressions.RAW - RGB: 24, 48 bpp
- ImGearCompressions.ASCII - RGB: 24, 48 bpp
ImageGear Write Support
- ImGearCompressions.RAW - RGB: 24, 48 bpp
- ImGearCompressions.ASCII - RGB: 24, 48 bpp
ImageGear Filter Control Parameters
None
Comments
The PPM format is useful for quick and easy transfer of color bitmap images. This format, as well as the PBM, PGM, and PNM formats, are at the core of a set of utility programs also written by Jef Poskanzer. These formats serve as intermediary storage methods for the conversion of other file formats. For example, a method called gifftoppm translates a GIF file to a PPM, where it can translate to a TIFF using the pnmtotiff.
The Portable Pixmap File Format structure is very simple. It begins with a short ASCII header that contains the file type identifier (magic number), the width and height of the image, a "maximum color-component value", and perhaps a comment line identifying the filename. Following white space (usually a carriage return) is the bitmap data. The number of pixels is equal to width * height, with each pixel being represented by three bytes: one each for Red, Green, and Blue color components, respectively.
The magic number of the header can have one of two values: either P3 or P6. P3 indicates that the bitmap data is read as ASCII decimal values. P6 indicates that the bitmap data is stored as plain bytes. This makes for a smaller and faster-to-read file.
If the maximum gray value exceeds 255 (28 = 256 gray values from 0 to 255), each pixel is represented by three 16-bit RGB samples, making a total of 48 bits per pixel. ImageGear loads such images to 24-bit RGB.
References Used
Kay, David C. and John R. Levine. Graphics File Formats, 2nd ed. Windcrest /McGraw-Hill, 1995.
PPM Specification by Jef Poskanzer, copyright A 1989, 1991.
See Also