ImageText-based

image/x-portable-graymap

PGM (Portable Graymap)

Reference for image/x-portable-graymap, the MIME type for PGM grayscale images in the Netpbm family.

MIME Type Detector

Drop a file to detect its MIME type — no upload, runs in your browser

📄

Drop any file here or click to choose

Expected extensions: .pgm

HTTP Content-Type Header

HTTP Header
Content-Type: image/x-portable-graymap; charset=utf-8

Associated File Extensions

.pgm

Quick Facts

MIME Typeimage/x-portable-graymap
CategoryImage
TypeText-based (human-readable)
Extensions.pgm

Common Usage

PGM stores grayscale images with configurable bit depth. It is used in scientific imaging, medical image processing, computer vision research, and as an intermediate format in image processing pipelines where simplicity is valued over compression.

Code Examples

HTML
<!-- Link or embed with explicit type -->
<link rel="stylesheet" href="file.pgm" type="image/x-portable-graymap">

<!-- Or for script/media elements -->
<script type="image/x-portable-graymap" src="file.pgm"></script>
Node.js
// Express.js
app.get('/file', (req, res) => {
  res.type('image/x-portable-graymap');
  res.send(data);
});

// Node.js http
res.writeHead(200, { 'Content-Type': 'image/x-portable-graymap' });
nginx
# nginx.conf — add to types block or use default
types {
    image/x-portable-graymap  pgm;
}

# Or set for a specific location
location /api/ {
    default_type image/x-portable-graymap;
}

Related MIME Types

More Image MIME Types

Other image types in the Image family

Related Tools

Explore More MIME Types

Browse our complete reference of 185 MIME types with usage examples, HTTP headers, and code snippets.