ArticleslgStudy

computer science

JBIG2

JBIG2 is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand JBIG2 rather than just read about it. In short: JBIG2 is an image compression standard for bi-level images, developed by the Joint Bi-level Image Experts Group. It is suitable for both lossless and lossy compression.

JBIG2 — main illustration
JBIG2 — illustration

Key takeaways

  • JBIG2 belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect JBIG2 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of JBIG2 from memory before moving on to harder problems.

Reference excerpt

JBIG2 is an image compression standard for bi-level images, developed by the Joint Bi-level Image Experts Group. It is suitable for both lossless and lossy compression. According to a press release from the Group, in its lossless mode JBIG2 typically generates files 3–5 times smaller than Fax Group 4 and 2–4 times smaller than JBIG, the previous bi-level compression standard released by the Group. JBIG2 was published in 2000 as the international standard ITU T.88, and in 2001 as ISO/IEC 14492.

Functionality Ideally, a JBIG2 encoder will segment the input page into regions of text, regions of halftone images, and regions of other data. Regions that are neither text nor halftones are typically compressed using a context-dependent arithmetic coding algorithm called the MQ coder. Textual regions are compressed as follows: the foreground pixels in the regions are grouped into symbols. A dictionary of symbols is then created and encoded, typically also using context-dependent arithmetic coding, and the regions are encoded by describing which symbols appear where. Typically, a symbol will correspond to a character of text, but this is not required by the compression method. For lossy compression the difference between similar symbols (e.g., slightly different impressions of the same letter) can be neglected; for lossless compression, this difference is taken into account by compressing one similar symbol using another as a template. Halftone images may be compressed by reconstructing the grayscale image used to generate the halftone and then sending this image together with a dictionary of halftone patterns. Overall, the algorithm used by JBIG2 to compress text is very similar to the JB2 compression scheme used in the DjVu file format for coding binary images. PDF files versions 1.4 and above may contain JBIG2-compressed data. Open-source decoders for JBIG2 are jbig2dec (AGPL), the java-based Apache PDFBox jbig2-imageio (Apache-2), the JavaScript-based jbig2.js (Apache-2), and the decoder by Glyph & Cog LLC found in Xpdf and Poppler (both GPL). An open-source encoder is jbig2enc (Apache-2).

Technical details Typically, a bi-level image consists mainly of a large amount of textual and halftone data, in which the same shapes appear repeatedly. The bi-level image is segmented into three regions: text, halftone, and generic regions. Each region is coded differently and the coding methodologies are described in the following passage.

Text image data Text coding is based on the nature of human visual interpretation. A human observer cannot tell the difference between two instances of the same characters in a bi-level image even though they may not exactly match pixel by pixel. Therefore, only the bitmap of one representative character instance needs to be coded instead of coding the bitmaps of each occurrence of the same character individually. For each character instance, the coded instance of the character is then stored into a "symbol dictionary". There are two encoding methods for text image data: pattern matching and substitution (PM&S) and soft pattern matching (SPM).

Pattern matching and substitution (PM&S) is the more classic coding method. The encoder performs image segmentation to isolate character-sized chunks. For each individual chunk, the encoder looks for a match in the bitmap dictionary. If a match exists, we code an index of the corresponding representative bitmap in the dictionary and the position of the character on the page. The position is usually relative to another previously coded character. If a match is not found, the segmented pixel block is coded directly and added into the dictionary. Typical procedures of pattern matching and substitution algorithm are displayed in the left block diagram of the figure above. Although the method of PM&S can achieve outstanding compression, substitution errors could be made during the process if the image resolution is low. JBIG2 improves on PM&S with optional soft pattern matching (SPM). The same segmentation and searching is performed, but for each found match, the encoder saves not only the corresponding dictionary entry, but also refinement data describing the difference between the actual chunk and the dictionary chunk. Doing so greatly reduces substitution errors. Since the dictionary match requires that the actual character and the dictionary character are highly similar, SPM only adds a tiny amount of data.

Halftones Halftone images can be compressed using two methods. One of the methods is similar to the context-based arithmetic coding algorithm, which adaptively positions the template pixels in order to obtain correlations between the adjacent pixels. In the second method, descreening is performed on the halftone image so that the image is converted back to grayscale. The converted grayscale values are then used as indexes of fixed-sized tiny bitmap patterns contained in a halftone bitmap dictionary. This allows decoder to successfully render a halftone image by presenting indexed dictionary bitmap patterns neighboring with each other.

Entropy coding All three region types including text, halftone, and generic regions may all use arithmetic coding or huffman coding. JBIG2 specifically uses the MQ coder, the same entropy encoder employed by JPEG 2000.

Patents Patents for JBIG2 are owned by IBM and Mitsubishi. Free licenses should be available after a request. JBIG and JBIG2 patents are not the same.

… excerpt ends here. Continue reading the full article.

Illustrations

JBIG2: Block diagrams of (left) pattern matching and substitution method and (right) soft pattern matching method
Block diagrams of (left) pattern matching and substitution method and (right) soft pattern matching method

Worked examples

Example 1 — a first encounter with JBIG2

Start with the simplest possible case. Write down what JBIG2 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to JBIG2 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about JBIG2 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of JBIG2

In research
JBIG2 appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses JBIG2 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
JBIG2 is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graphics file formats, Image compression, JBIG, so understanding it makes those chapters shorter.
In everyday life
Look for JBIG2 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “JBIG2” →

How to study JBIG2 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what JBIG2 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain JBIG2 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is JBIG2 in simple terms?

JBIG2 is an image compression standard for bi-level images, developed by the Joint Bi-level Image Experts Group. It is suitable for both lossless and lossy compression.

Why does JBIG2 matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study JBIG2?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on JBIG2.

Tags

  • Graphics file formats
  • Image compression
  • JBIG
  • Lossless compression algorithms
  • Lossy compression algorithms

Keep exploring