{"id":2592,"date":"2026-08-08T01:50:57","date_gmt":"2026-08-07T22:50:57","guid":{"rendered":"https:\/\/picajet.com\/articles\/formats\/pgm\/"},"modified":"2026-08-08T03:47:19","modified_gmt":"2026-08-08T00:47:19","slug":"pgm","status":"publish","type":"format","link":"https:\/\/picajet.com\/articles\/formats\/pgm\/","title":{"rendered":"PGM"},"content":{"rendered":"<p class=\"wp-block-paragraph\">PGM followed PBM by the end of 1988, added by Jef Poskanzer to Pbmplus once it became clear that a bitonal format alone couldn&#8217;t serve grayscale imaging needs. It kept the same design philosophy \u2014 a trivially simple header plus raw samples, readable and writable by almost any tool with minimal effort \u2014 but added the tonal range needed for photographs and scientific data converted to gray levels.<\/p><p class=\"wp-block-paragraph\">In practice, PGM today survives mainly as an interchange format inside computer-vision and scientific-imaging toolchains (test datasets, sensor dumps, algorithm output) rather than as a photographic deliverable. For a DAM, that means PGM files usually arrive as intermediate artifacts from an image-processing pipeline, not as assets with their own rights or captioning needs. The practical rule is the same as for PBM and PPM: PGM is fine as a working format between tools, but a DAM should normalize it to TIFF or PNG before treating it as a catalogued, metadata-bearing asset.<\/p>","protected":false},"excerpt":{"rendered":"<p>A Netpbm raster format storing 8-bit (or 16-bit, since a 2000 extension) grayscale intensity values per pixel in plain-text or raw binary form, used as a simple portable intermediate image format.<\/p>\n","protected":false},"author":0,"featured_media":0,"template":"","meta":{"footnotes":"","faq":[{"question":"Can PGM carry EXIF, IPTC, or XMP metadata?","answer":"No. Like the other Netpbm formats, PGM has no provision for EXIF, IPTC, XMP, or ICC metadata, and no support for layers, transparency, or color."},{"question":"What bit depths does PGM support for grayscale data?","answer":"8-bit by default, with a 2000 extension to the Netpbm formats allowing 2 bytes per sample for a maximum value of 65535, which matters when a DAM needs to preserve tonal precision from scientific-imaging sources."},{"question":"Is PGM suitable as a DAM archival master?","answer":"No. PGM is well suited to scientific-imaging and computer-vision working pipelines but not to archival, since it cannot embed provenance, rights, or descriptive metadata; convert to TIFF or PNG for long-term cataloging."},{"question":"What does a PGM file structurally contain?","answer":"A short header with magic number, dimensions, and maximum gray value, followed by uncompressed grayscale samples, in either plain-text or raw binary form."},{"question":"Which software commonly reads and writes PGM in practice?","answer":"GIMP for general editing, Netpbm tools and ImageMagick's convert for conversion, and OpenCV, MATLAB, and scikit-image for scientific-computing and computer-vision use cases."},{"question":"Does PGM support color images?","answer":"No. PGM is grayscale-only; RGB color needs PPM, its sibling format in the Netpbm family."},{"question":"Why might a DAM encounter PGM files at all?","answer":"PGM commonly appears as an output or intermediate format from scientific-imaging and computer-vision pipelines, where its simple, uncompressed, tool-agnostic structure makes it easy for research software to write and read."},{"question":"Is PGM compressed?","answer":"No. PGM stores uncompressed grayscale samples, which keeps file sizes larger than a comparable PNG and is another reason to convert it before long-term DAM storage."}],"checked_date":"2026-08-07","sources":[{"statement":"By the end of 1988 Jef Poskanzer had added the PGM and PPM formats to Pbmplus.","source_name":"Netpbm History","url":"https:\/\/netpbm.sourceforge.net\/history.html","checked":"2026-08-07"},{"statement":"In the binary Netpbm formats, PGM uses 8 bits per pixel.","source_name":"Adobe - What are PPM files and how do you open them?","url":"https:\/\/www.adobe.com\/creativecloud\/file-types\/image\/raster\/ppm-file.html","checked":"2026-08-07"},{"statement":"In April 2000 the Netpbm formats were extended to allow 2 bytes per sample, for a maximum maxval of 65535.","source_name":"Wikipedia - Netpbm","url":"https:\/\/en.wikipedia.org\/wiki\/Netpbm","checked":"2026-08-07"}],"kicker":"","fact_checker":0,"reading_time":0,"revisions":[],"seo_title":"","seo_description":"","noindex":false,"ext":"pgm","full_name":"Portable Graymap","vendor_name":"Jef Poskanzer \/ the Netpbm project","introduced":"1988, added to Pbmplus alongside PPM","container_notes":"A PGM file carries a short header (magic number, dimensions, maximum gray value) followed by uncompressed grayscale samples; the April 2000 extension to the Netpbm formats allowed 2 bytes per sample for a maximum value of 65535. Like its siblings, PGM has no provision for EXIF, IPTC, XMP, or ICC metadata, and no layers, transparency, or color.","open_with":[{"platform":"Cross-platform editor","how":"GIMP opens and exports PGM"},{"platform":"Command line","how":"Netpbm tools and ImageMagick convert read\/write PGM"},{"platform":"Scientific computing","how":"OpenCV, MATLAB, and scikit-image commonly read\/write PGM for grayscale test data"},{"platform":"Viewers","how":"IrfanView and XnView open PGM for inspection"}],"archive_advice":"PGM is well suited to scientific-imaging and computer-vision working pipelines but not to DAM archival \u2014 it cannot embed provenance, rights, or descriptive metadata. Convert any PGM asset destined for long-term cataloging to TIFF or PNG so a DAM can attach and preserve the metadata it needs.","related":[2605,2610,2591,2606,2609,2600],"tool_link":""},"silo":[23],"class_list":["post-2592","format","type-format","status-publish","hentry","silo-formats"],"_links":{"self":[{"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/format\/2592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/format"}],"about":[{"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/types\/format"}],"version-history":[{"count":3,"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/format\/2592\/revisions"}],"predecessor-version":[{"id":3650,"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/format\/2592\/revisions\/3650"}],"wp:attachment":[{"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/media?parent=2592"}],"wp:term":[{"taxonomy":"silo","embeddable":true,"href":"https:\/\/picajet.com\/articles\/wp-json\/wp\/v2\/silo?post=2592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}