PGM is netpbm's grayscale format — 8 or 16-bit samples, ASCII or binary, zero compression. Computer-vision research and image-processing courses live on it.
Typical use: Convert PGM grayscale to PNG/JPG for viewing, or emit PGM for scientific pipelines that require raw pixel honesty.
About the PGM format
PGM is netpbm's grayscale format: a two-line text header, then raw 8 or 16-bit luminance samples with no compression and no metadata. That raw honesty made it the default exchange format of computer-vision research, image-processing coursework and any pipeline where "what you read is exactly the pixel value" matters.
Converting PGM to PNG or JPG just normalizes it for humans; converting back down preserves every value bit-exactly when the pipeline needs numbers, not pictures.
Strengths
- ✓ Bit-exact pixel values, no color management surprises
- ✓ 16-bit depth support
- ✓ Trivially parseable
Limitations
- ✗ No compression — large files
- ✗ Grayscale only
- ✗ No embedded metadata
- Structure
- P2 (ASCII) / P5 (binary) header + samples
- Types / schema
- 8/16-bit grayscale
- Compatibility
- netpbm, OpenCV, MATLAB
- Best for
- Research pipelines, raw luminance
Convert PGM to…
48 direct directions plus 12 workflows, sorted A–Z; 🔥 marks popular targets.
Cross-engine workflows
Convert other files to PGM…
Frequently asked questions
What is a PGM file?
PGM is netpbm's grayscale format — 8 or 16-bit samples, ASCII or binary, zero compression. Computer-vision research and image-processing courses live on it.
How do I convert PGM files online?
Pick a target format from the "Convert PGM to…" list below, drop your file and hit convert. Everything runs in your browser — no install, no upload, no watermark, no limits.
Is it safe to convert PGM files here?
Yes. Every conversion is performed by your own device inside the browser — files never leave for a server, and the page keeps working even offline.
Which formats can PGM convert to?
This page lists all 60 directions across documents, images, audio, video, spreadsheets and archives — each one is its own free converter page.