PGM and Netpbm decoding
Portable Graymap files store grayscale raster data in the Netpbm family. This viewer recognizes the Netpbm magic value, skips comments and whitespace, reads image dimensions and maximum sample value, and converts supported pixels to a browser canvas for preview.
Both plain-text P2 and binary P5 PGM data are supported by the fallback parser. The shared Netpbm parser can identify related PBM and PPM signatures, but this page is tuned for .pgm input. Higher sample ranges are scaled for an on-screen preview; the original file remains unchanged.
Open or export a PGM image
- Agħżel a file, drop it onto the page, or load a CORS-enabled URL.
- Check the reported dimensions, Netpbm type, and maximum sample valur.
- Preview the grayscale image and export the rendered canvas as PNG when decoding succeeds.
Malformed headers, truncated pixel data, or unsupported variants produce a visible metadata fallback instead of a blank canvas. Local files stay in the browser.