Free webp to jpg
PPM

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.

Raster Graphics ✦ HDR Production Ready

Technical Specifications

MIME Type
image/x-portable-pixmap
Extensions
.ppm
Container
Netpbm
Compression
Uncompressed
Algorithms
None
Color Depth
24-bit (RGB), 48-bit (RGB High Color)
Metadata
None
Capabilities
Transparency
Animation
Progressive Loading
Alpha Channel
HDR Support
Official Specification
Aliases: image/ppm

Magic Bytes & HTTP Headers

File Signature (Magic Bytes)
50 33 (ASCII) or 50 36 (Binary)
ASCII: P3 or P6
HTTP Headers
Content-Type: image/x-portable-pixmap
HTML Accept Attribute
accept="image/x-portable-pixmap, .ppm"

Browser Support Matrix

Browser Status Min Version
Chrome Chrome
Not Supported
Firefox Firefox
Not Supported
Safari Safari
Not Supported
Edge Edge
Not Supported
Internet Explorer Internet Explorer
Not Supported Legacy

Advantages & Limitations

Advantages
  • 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
Limitations
  • 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

import magic
# Libmagic natively detects PPM files and correctly identifies them based on the P3/P6 signature
print(magic.from_file('render.ppm', mime=True)) # Outputs 'image/x-portable-pixmap'
const fs = require('fs');
// Manually checking the PPM magic bytes (P3 or P6)
const buffer = Buffer.alloc(2);
const fd = fs.openSync('render.ppm', 'r');
fs.readSync(fd, buffer, 0, 2, 0);
fs.closeSync(fd);
const isPPM = buffer[0] === 0x50 && (buffer[1] === 0x33 || buffer[1] === 0x36);
console.log('Is Portable Pixmap (PPM):', isPPM);
import (
    "bytes"
    "net/http"
)
// Native Go HTTP detection does not recognize PPM natively.
// Check directly for the P3 or P6 signatures:
// isPPM := len(buf) >= 2 && buf[0] == 'P' && (buf[1] == '3' || buf[1] == '6')
$mime = mime_content_type('render.ppm');
echo $mime; // Standard PHP setups typically return 'image/x-portable-pixmap'

File Detection Steps

How to programmatically detect a image/x-portable-pixmap file by reading its raw bytes:

  1. 1 A PPM file always begins with a 2-byte magic number starting with 'P' (Hex: 50).
  2. 2 The second byte determines the encoding: '3' (Hex: 33) for plain ASCII text, and '6' (Hex: 36) for raw binary.
  3. 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

N
Netpbm (Command-line tools)
ImageMagick ImageMagick
GIMP GIMP
X
XnView

Conversion Tools

Share & Embed

Markdown Badge
PPM Format Badge
[![PPM Format](https://freewebptojpg.com/mime/image/ppm/badge.svg)](https://freewebptojpg.com/mime/image/ppm)
Interactive iframe Widget
<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
Free to use
No auth required
CORS enabled
Use from any domain
Cached 24h
Cache-Control headers set

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.

Related Formats

Share this format