Image MIME Reference
JPEG
JPEG Image
image/jpeg
VS
Portable Bitmap
image/x-portable-bitmap
PBM
A complete technical comparison of JPEG Image and Portable Bitmap — covering compression, feature support, browser compatibility, magic bytes, and when to choose each format.
JPEG wins on browser support
Feature Support
| Feature | JPEG | PBM |
|---|---|---|
| Transparency (Alpha) | ✕ No | ✕ No |
| Animation Support | ✕ No | ✕ No |
| Progressive Loading | Yes | ✕ No |
| HDR Support | ✕ No | ✕ No |
| EXIF Metadata | Yes | ✕ No |
| ICC Color Profile | Yes | ✕ No |
JPEG Image
image/jpeg
Extension
.jpg.jpeg.jpe.jfif
Container
JFIF / Exif
Compression
Lossy
Algorithm
DCT (Discrete Cosine Transform)
Color Depth
8-bit
Developed by
Joint Photographic Experts Group
Released
1992
Magic Bytes
FF D8 FF
Portable Bitmap
image/x-portable-bitmap
Extension
.pbm
Container
Netpbm
Compression
Uncompressed
Algorithm
None
Color Depth
1-bit (Monochrome)
Developed by
Jef Poskanzer (Netpbm Project)
Released
1988
Magic Bytes
50 31 (ASCII) or 50 34 (Binary)
Browser Support Comparison
| Browser | JPEG | PBM |
|---|---|---|
|
|
✓ All
|
✕ |
|
|
✓ All
|
✕ |
|
|
✓ All
|
✕ |
|
|
✓ All
|
✕ |
|
|
✓
|
✕ |
JPEG
JPEG Strengths
- Universal support — every browser, OS, and application handles JPEG
- Excellent compression for complex photographs with natural color gradients
- Rich metadata support: EXIF (GPS, camera settings), ICC color profiles
Limitations
- No transparency — cannot have a transparent background
- Lossy compression introduces visible artifacts on sharp edges and text
- No animation support
PBM
PBM Strengths
- Absolute structural simplicity allows parsers to be written from scratch with just a few lines of code
- ASCII encoding allows manual editing and debugging directly within a standard text editor
- Serves as a flawless, lossless intermediary for 1-bit raster data like scanned documents or barcodes
Limitations
- Strictly limited to 1-bit monochrome images; cannot natively display shades of gray or color
- Lack of compression results in extremely large file sizes, particularly when using the ASCII 'P1' encoding
- No support for alpha transparency or modern metadata standards like EXIF
When to choose which format
JPEG
Use JPEG when…
- Photography
- Websites
- Social Media
PBM
Use PBM when…
- Optical Character Recognition (OCR) Pre-processing
- Unix/Linux Command-Line Image Pipelines
- Academic Image Processing Teaching