What is MIME type "image/x-jbig2"?
A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.
image/x-jbig2 is a MIME type for images compressed with the JBIG2 method.It handles bi-level (black and white) images commonly found in scanned documents.
This format offers both lossless and lossy compression to reduce file sizes while keeping text details sharp.
- Used in digital archival of scanned documents.
- Embedded in PDFs for scanned page images.
- Optimized for fax and printing workflows.
For more details, visit the Wikipedia page on JBIG2.
Associated file extensions
Usage Examples
HTTP Header
When serving content with this MIME type, set the Content-Type header:
Content-Type: image/x-jbig2
HTML
In HTML, you can specify the MIME type in various elements:
<a href="file.dat" type="image/x-jbig2">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-jbig2');
res.end('Content here');
}).listen(3000);
Associated file extensions
FAQs
Do web browsers natively support image/x-jbig2 files?
No, standard web browsers like Chrome, Firefox, and Safari do not support JBIG2 images directly. To display these images on a website, they should be converted to widely supported formats like PNG or embedded within a PDF file, as most PDF readers handle the JBIG2 stream internally.
How do I configure Apache to serve .jb2 files correctly?
You can enable the correct MIME type by adding a directive to your .htaccess file or main configuration. Add the line: AddType image/x-jbig2 .jb2 .jbig2. This ensures the server tells the client that the file is a JBIG2 image.
What is the difference between lossless and lossy JBIG2 compression?
Lossless JBIG2 retains every pixel exactly as scanned, which is safer for archival. Lossy JBIG2 uses pattern matching to group similar symbols (like letters) together; this significantly reduces file size but carries a risk of character substitution errors if the compression is too aggressive.
Why can't I open a .jbig2 file on my computer?
Because image/x-jbig2 is a specialized format mostly used inside PDFs or fax workflows, default OS image viewers (like Windows Photos or macOS Preview) often cannot open raw .jbig2 files. You will likely need specialized software like XnView, IrfanView, or ImageMagick to view or convert them.
How do I add support for JBIG2 in Nginx?
Open your mime.types file (usually located in /etc/nginx/) and add the entry within the types block. The line should look like this: image/x-jbig2 jb2 jbig2;. Reload Nginx afterwards to apply the changes.
Is image/x-jbig2 better than TIFF for scanned documents?
Generally, yes, in terms of file size. JBIG2 usually compresses bi-level (black and white) images 20% to 50% better than the standard TIFF Group 4 compression. However, TIFF is much more compatible with standard image editing software.
What does the 'x-' prefix mean in image/x-jbig2?
The x- prefix indicates that the MIME type is a non-standard or private extension, rather than a standard type registered with IANA. Although JBIG2 is an ISO standard, the MIME identifier image/x-jbig2 is widely used in the industry to identify these streams before a formal registration occurs.
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.