What is MIME type "image/x-bpg"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

image/x-bpg is the MIME type for the Better Portable Graphics format. It defines how files with this format are treated by browsers and applications. Files with this type are compressed images that aim to deliver high quality at small sizes. See BPG for more details on the file extension.

Its main purpose is to provide an image format that uses modern data compression techniques based on HEVC (High Efficiency Video Coding). This allows for better visual quality with less disk space compared to older formats.

The format is experimental. Many systems might require conversion to more common formats for full compatibility.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: image/x-bpg    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="image/x-bpg">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'image/x-bpg');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

Do web browsers natively support image/x-bpg?

No, major browsers like Chrome, Firefox, and Safari do not support image/x-bpg natively. To display these images on a website, developers must include a specific JavaScript decoder (such as bpgdec.js) that renders the image onto an HTML5 canvas.

How do I configure Apache or Nginx to serve BPG files?

For Apache, add the line AddType image/x-bpg .bpg to your .htaccess file or server configuration to associate the extension. For Nginx, add image/x-bpg bpg; to your mime.types file or inside the types { ... } block to ensure the correct Content-Type header is sent.

What is the difference between image/x-bpg and image/jpeg?

The image/x-bpg format provides significantly better compression and visual quality than standard image/jpeg files, often resulting in much smaller file sizes for the same quality. However, JPEG is universally supported by all image viewers and browsers, whereas BPG requires special software or scripts to view.

Why does the MIME type start with x-?

The x- prefix in image/x-bpg signifies that it is a non-standard or experimental subtype not formally registered with the Internet Assigned Numbers Authority (IANA). While it is the accepted identifier for Better Portable Graphics, it distinguishes the format from standardized types like image/png.

What should I do if my BPG images are not displaying on my site?

First, ensure you have included the required JavaScript decoder library in your HTML code. Second, check your browser's network tab to verify the server is returning the file with the correct Content-Type: image/x-bpg header instead of a generic application/octet-stream.

Can I use image/x-bpg for production websites?

It is generally not recommended for mainstream production sites due to the lack of native browser support and the performance cost of JavaScript decoding on the client side. Formats like image/webp or AVIF are usually better alternatives for modern high-compression needs because they have native browser support.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.