Better Portable Graphics MIME Type Reference
image/bpg
Released 2014
· by Fabrice Bellard
Better Portable Graphics (BPG) is a modern, high-efficiency raster image format created in 2014 by programmer Fabrice Bellard. It wraps the intra-frame encoding of the HEVC (H.265) video compression standard, offering phenomenal compression ratios, native alpha channel transparency, and high color depths.
Technical Specifications
.bpg
HEVC (H.265)
image/x-bpg
Magic Bytes & HTTP Headers
BPG\xFB
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | Legacy |
Advantages & Limitations
- Exceptional compression efficiency that vastly outperforms standard JPEG at similar quality levels
- Supports high bit depths (up to 14 bits per channel), lossless compression, and alpha channel transparency within a single format
- The official JavaScript decoder allows the format to be rendered on standard HTML5 canvas elements
- HEVC (H.265) patent encumbrance prevented native adoption in major web browsers
- Superseded conceptually by the open, royalty-free AVIF format
- Encoding BPG files is computationally intensive and requires specialized command-line tools
Developer Code Snippets
File Detection Steps
How to programmatically detect a image/bpg
file by reading its raw bytes:
- 1 Check the first 4 bytes for the BPG signature (42 50 47 FB)
- 2 Include the official 'bpgdec.js' Javascript decoder library if serving via web, as standard HTML <img> tags will fail
Software Support
Free Online Tools for BPG
Resize, scale, crop, and modify dimensions for any photo or graphic.
Clean EXIF, camera, lens, and location tags from your photos.
Convert modern web images to universal high-compatibility JPG.
Reduce image file sizes for faster web performance.
BPG Format Comparisons
Share & Embed
[](https://freewebptojpg.com/mime/image/bpg)
<iframe src="https://freewebptojpg.com/mime/image/bpg/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="BPG Specs"></iframe>
JSON API
All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.
GET https://freewebptojpg.com/mime/image/bpg.json
Open JSON
Frequently Asked Questions
What is the magic byte for image/bpg?
BPG images contain a 4-byte magic signature at offset 0. The first four bytes are 42 50 47 FB in hex, corresponding to the ASCII string 'BPG' followed by the 0xFB byte.
Is image/bpg natively supported in web browsers?
No. Despite its technical advantages, BPG was never natively adopted by major web browsers due to the patent royalties associated with its underlying HEVC (H.265) compression. It requires a JavaScript polyfill to render on the web.
What is the difference between BPG and AVIF?
Both are next-generation image formats based on video codecs. BPG uses the proprietary HEVC (H.265) codec, while AVIF uses the open, royalty-free AV1 codec. AVIF eventually won the web standard war due to its open licensing model.