{"id":"image-bpg","mimeType":"image/bpg","name":"Better Portable Graphics","shortName":"BPG","category":"Professional \u0026 Broadcast Imaging","extensions":[".bpg"],"description":"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.","seo":{"title":"image/bpg MIME Type: BPG Specs, Headers \u0026 Magic Bytes","description":"Complete developer reference for image/bpg (.bpg): magic bytes, HTTP headers, browser support, developer code snippets, and technical specifications.","faqs":[{"question":"What is the magic byte for image/bpg?","answer":"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."},{"question":"Is image/bpg natively supported in web browsers?","answer":"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."},{"question":"What is the difference between BPG and AVIF?","answer":"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."}]},"index":{"compression":["HEVC (H.265) Intra-frame","Lossless"],"browserSupport":{"score":1,"label":"None"},"commonUses":["High-Efficiency Image Archival","Bandwidth-Constrained Environments (via JS decoder)"]},"technical":{"magicBytes":{"hex":"42 50 47 FB","ascii":"BPG\\xFB"},"container":"Custom BPG Header","compressionAlgorithm":["HEVC (H.265)"],"colorDepth":["8-bit (Per Channel)","10-bit (Per Channel)","12-bit (Per Channel)","14-bit (Per Channel)"],"transparency":true,"animation":true,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":false},"history":{"developer":"Fabrice Bellard","released":"2014","specification":"BPG Image format specification"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"bpgview (Official Viewer)","logo":""},{"name":"ImageMagick","logo":""},{"name":"XnView","logo":""},{"name":"Honeyview","logo":""}],"conversion":{"convertTo":["avif","webp","jpeg","png"],"convertFrom":["jpeg","png","webp","heic"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/bpg"}],"htmlAccept":"image/bpg, .bpg","fileDetection":["Check the first 4 bytes for the BPG signature (42 50 47 FB)","Include the official 'bpgdec.js' Javascript decoder library if serving via web, as standard HTML \u003cimg\u003e tags will fail"]},"prosCons":{"pros":["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"],"cons":["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"]},"specifications":{"url":"https://bellard.org/bpg/","rfc":"","mimeAliases":["image/x-bpg"]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('file.bpg', mime=True)) # Outputs 'image/bpg'","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('file.bpg');\nconsole.log(type.mime); // image/bpg","go":"import \"net/http\"\n\nmimeType := http.DetectContentType(fileBytes)\nfmt.Println(mimeType) // Note: Standard net/http may default to application/octet-stream for BPG","php":"$mime = mime_content_type('file.bpg');\necho $mime; // image/bpg"},"relatedFormats":["heic","avif","webp","jpeg","flif"]}
