Open Source Jbig2 Encoder and Decoder

because studying PDF compress, I collected some open source Jbig2 Encoder and Decoder.

JBIG2 encodes bi-level (1 bpp) images using a number of clever tricks to get better compression than G4. developed in C. To get windows compiled version, please visit here,JBig2enc Win32 version.

This encoder can:

  • Generate JBIG2 files, or fragments for embedding in PDFs
  • Generic region encoding
  • Perform symbol extraction, classification and text region coding
  • Perform refinement coding and,
  • Compress multipage documents

Lossless JBIG2 Encoder Windows Dynamic Libary: bases on Jbig2, but easily integrate with your own application.

The JPedal JBIG2 Image Decoder is a 100% pure Java image decoder for the JBIG2 file format. The decoder takes the JBIG2 image processing technology developed for the Java PDF viewer and makes it available as a generic library for more general usage.

It offers the ability to allow developers to add JBIG2 image rendering capabilities to their own applications, through a simple and easy to use API. In its simplest form it allows developers to load in a JBIG2 encoded datastream and convert that into a BufferedImage.

Version 1 is available under a BSD license to provide a JBig2 decoder. It is used in many projects, including some of our competitors.

Version 2 is a faster, enhanced version available under a commerical license only. It is used in the commercial versions of JPedal from 4.21 onwards.

JBIG2-Image-Decoder:is a fork of JPedal’s JBIG2 library, which aims to improve the performance of the original code.

jbig2.js:JavaScript implementation of the JBIG2 specification.

jbig2dec is a decoder implementation of the JBIG2 image compression format. JBIG2 is designed for lossy or lossless encoding of ‘bilevel’ (1-bit monochrome) images at moderately high resolution, and in particular scanned paper documents. In this domain it is very efficient, offering compression ratios on the order of 100:1.

This is a decoder only implementation, and currently is in the alpha stage, meaning it doesn’t completely work yet. However, we are maintaining parity with available encoders, so it is useful for real work.

jbig2-imageio:A Java ImageIO plugin for the JBIG2 bi-level image format

The Java ImageIO plugin for JBIG2 enables access to images encoded using the JBIG2 image compression standard.

The key features of the plugin are:

  • Read-only (decode) support for images encoded using the JBIG2 standard, aka ITU T.88 and ISO/IEC 14492.
  • Full support for all features defined in the standard, including arithmetic coding, Huffman coding and MQ coding.
  • Pure Java code. No funny native or JNI stuff required.
  • Secure.
  • Production quality. Robust and well-tested.
  • Reasonable performance.
  • Standard ImageIO API.
  • Support for shared data segments as used by PDF via custom DecodeParams.

JBIG-KIT is a software implementation of the JBIG1 data compression standard (ITU-T T.82), which was designed for bi-level high-resolution image data such as scanned documents. This library is available in portable C code and has been widely used in fax products, printer firmware and drivers, and document management systems. The package includes a variant implementation of just the ITU-T T.85 profile, with memory management optimized for embedded and fax applications.

P.S.

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[1] from the Group, in its lossless mode JBIG2 typically generates files one third to one fifth the size of Fax Group 4 and one half to one quarter the size of JBIG, the previous bi-level compression standard released by the Group. JBIG2 has been published in 2000 as the international standard ITU T.88[2], and in 2001 as ISO/IEC 14492[3].

Be Sociable, Share!

Jbig2.pdf.py.patch-The right way to get DPI

Yesterday, I got a comment on Jbig2

Hi Steven,
thanks for the port to windows. It works very good, produces small pdf-file sizes. Only one strange thing happens. The generate pdf files have a huge page-size. For example if I process A4-size pages (29.7×20.9cm) @400dpi tiff or png the pdf file size is 164.9×116.6 cm.
Is it possible to fix this by the python pdf.py or is jbig2.exe responible for this?
Thanks
Armin

after check the last version pdf.py, I notice it uses a default DPI(600). Images has different DPI, so if you want to use pdf.py, you need always modify it, it is not a good solution.

Then I check the source code of jbig, and found in jbig2_page_info structure ,

struct jbig2_page_info {
  u32 width;
  u32 height;
  u32 xres;
  u32 yres; ...

we can get xres and yres, so we can directly use xres and yres to generated proper page size.

and here is the patch file

btw, you can also download the last version jbig2 from here.

P.S.

Armin became the first user, and here is his response,

Hi Steven,
thank you very much for your quick response, and the new pdf.py
which works perfect. (I checked it with my 400dpi page scans.
the pdf page size is now of the same size as the scans)

Thank you so much,
Greetings from rainy Germany :-)

Armin

Be Sociable, Share!

JBIG2Enc Win32 Version update to 0.27

Today(Oct 26, 2010), I got a email about JBIG2 Encoder win32 binary update request,

Dear Steven,

I came across your Windows compiled version of jbig2enc. It’s very
useful – thanks a lot for making it available!

I was wondering whether you might consider making a new binary from the
latest Git version, which adds support for retaining DPI information. I
have been having a lot of trouble getting it to compile myself in MinGW.

Best,

Misty De Meo

After some efforts, the win32 version jbig2enc 0.27 is out, and can be download from Windows version JBIG2 Encoder-Jbig2.exe.

btw, I used leptonlib-1.66, not leptonlib-1.58 in the compilation.

P.S.
David Foster donated US$60, thanks.

Be Sociable, Share!