Portable Pixmap
image/x-portable-pixmap
Released 1988
· by Jef Poskanzer (Netpbm Project)
The image/x-portable-pixmap MIME type represents the Portable Pixmap (PPM) format, the color imaging member of the Netpbm family of formats. Created by Jef Poskanzer in the late 1980s, PPM is an uncompressed, highly simplified raster image format that stores pixel data as RGB (Red, Green, Blue) color triplets. It features two encoding variants: a human-readable ASCII plaintext version (designated by the 'P3' magic number) where pixel values are written as readable text integers, and a more compact raw binary version ('P6'). Because of its extreme structural simplicity, it is widely used as a lowest-common-denominator intermediary format for image conversion pipelines and academic computer graphics programming.
Technical Specifications
.ppm
None
image/ppm
Magic Bytes & HTTP Headers
P3 or P6
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | Legacy |
Advantages & Limitations
- Absolute structural simplicity allows parsers and renderers (such as custom raytracers) to write directly to the format with virtually no overhead or external libraries
- Supports 16-bit per channel (48-bit total) precision, preserving deep color accuracy before converting to final delivery formats
- ASCII encoding ('P3') allows manual editing and visual inspection of RGB values directly within a text editor
- Zero compression results in astronomical file sizes, making it entirely impractical for web delivery or consumer storage
- Does not natively support an alpha channel for transparency (this is handled by the newer PAM extension format within the Netpbm suite)
- Lacks support for modern metadata standards like EXIF, XMP, or embedded ICC color profiles
Developer Code Snippets
File Detection Steps
How to programmatically detect a image/x-portable-pixmap
file by reading its raw bytes:
- 1 A PPM file always begins with a 2-byte magic number starting with 'P' (Hex: 50).
- 2 The second byte determines the encoding: '3' (Hex: 33) for plain ASCII text, and '6' (Hex: 36) for raw binary.
- 3 Following the magic bytes are whitespace-separated ASCII numbers defining the image's width, height, and the maximum color value for each RGB channel (usually 255 for 24-bit color, or 65535 for 48-bit color).
Software Support
ImageMagick
Conversion Tools
Share & Embed
[](https://freewebptojpg.com/mime/image/ppm)
<iframe src="https://freewebptojpg.com/mime/image/ppm/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="PPM Specs"></iframe>
JSON API
All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.
GET https://freewebptojpg.com/mime/image/ppm.json
Open JSON
Frequently Asked Questions
What is a PPM file?
A PPM (Portable Pixmap) file is an uncompressed RGB color image format. Part of the Netpbm suite, it represents pixels using red, green, and blue values without any compression, making it very easy to read and write programmatically.
What is the difference between PPM, PGM, and PBM?
They are all part of the Netpbm family. PBM (Portable Bitmap) is strictly 1-bit black and white. PGM (Portable Graymap) is grayscale. PPM (Portable Pixmap) supports full RGB color. Each uses different magic numbers in their file headers to identify themselves.
Why are PPM files so large?
PPM files do not use any form of data compression. Every single pixel requires 3 bytes (for 24-bit color) or 6 bytes (for 48-bit color) of storage. This results in massive file sizes compared to modern compressed formats like JPEG or PNG.