GdPicture.NET is a Nutrient product. Learn more

JBIG2 compression SDK for .NET: Shrink PDFs and images

Achieve superior compression ratios for scanned documents and bitonal images with GdPicture.NET’s JBIG2 encoder. Read and write single-page or multipage JBIG2 files, embed JBIG2 compression in PDFs, and choose between lossless or lossy encoding for optimal quality across 100+ input formats.



Purpose-built JBIG2 compression engine

JBIG2 is an image compression standard optimized for bi-level (black and white) images. This engine reads, writes, and converts with both lossless and lossy compression, delivering significantly smaller files than CCITT4 with full multithreading and AnyCPU support.

JBIG2 compression visualization
Full JBIG2 support

Read and write single-page and multipage JBIG2 images with complete format compatibility.

100+ input formats

Convert documents and images from more than 100 formats to JBIG2 for archiving, storage, and distribution.

Smaller PDFs

Replace CCITT/fax/decode compression in PDFs with JBIG2Decode compression for dramatically reduced file sizes.

Lossless and lossy modes

Choose lossless compression for exact reproduction, or lossy mode with intelligent pattern matching to minimize undesired artifacts.

2–5× better compression

Achieve significantly smaller files than CCITT4 while maintaining low memory usage during encoding.

Built for scale

Deploy on AnyCPU with 32-bit and 64-bit support. Process documents in parallel with full multithreading.

DEMO

Test JBIG2 compression

Upload a document to see JBIG2 compression in action. Compare file sizes and quality with your own files.

GET STARTED

How to use

Download and install the GdPicture.NET package to access compiled demo applications and multi-language sample projects with full source code.

Explore demo apps
Find compiled demo applications in \Samples\Bin\.
Explore multi-language source code
Find C# and VB.NET demo apps and source code in \Samples\WinForm\.
Visit reference guide
Explore other code snippets within the online reference guide.

Example of usage

This example uses JBIG2 and JPEG2000 schemes to compress images in a PDF document.

using GdPicturePDFReducer gdpicturePDFReducer = new GdPicturePDFReducer();
// Configure the metadata of the resulting PDF document.
gdpicturePDFReducer.PDFReducerConfiguration.Author = "Nutrient .NET PDF Reducer SDK";
gdpicturePDFReducer.PDFReducerConfiguration.Producer = "GdPicture.NET 14";
gdpicturePDFReducer.PDFReducerConfiguration.ProducerName = "Nutrient";
gdpicturePDFReducer.PDFReducerConfiguration.Title = "Image Compression";
// Specify the version and the conformance level of the output PDF document.
gdpicturePDFReducer.PDFReducerConfiguration.OutputFormat = PDFReducerPDFVersion.PdfVersionRetainExisting;
// Enable automatic color detection.
gdpicturePDFReducer.PDFReducerConfiguration.EnableColorDetection = true;
// Repair characters.
gdpicturePDFReducer.PDFReducerConfiguration.EnableCharRepair = true;
// Control image compression.
gdpicturePDFReducer.PDFReducerConfiguration.EnableJPEG2000 = true;
gdpicturePDFReducer.PDFReducerConfiguration.EnableJBIG2 = true;
gdpicturePDFReducer.PDFReducerConfiguration.JBIG2PMSThreshold = 0.65f;
// Run the compression process.
gdpicturePDFReducer.ProcessDocument(@"C:\temp\source.pdf", @"C:\temp\output.pdf");

Trusted by 3,000+ customers and Fortune 500 companies

15Y+
More than 15 years of experience developing our SDK
10K+
Trusted by more than 10,000 developers


Frequently asked questions

What is JBIG2, and how does it benefit document compression?

JBIG2 is an image compression standard for bi-level (black and white) images, developed by the Joint Bi-level Image Experts Group. It offers superior compression ratios, achieving 2 to 5 times more compression than the CCITT Group 4 standard, which significantly reduces file sizes and optimizes storage and transmission efficiency.

What are the main features of the GdPicture.NET JBIG2 library?

The library provides a range of features, including:

Efficiency — Low memory usage and compatibility with multithreaded applications.

Reading and writing — Support for single-page and multipage JBIG2 images.

Format conversion — Ability to convert more than 100 document formats to JBIG2.

PDF compression enhancement — Use of the JBIG2Decode filter to improve PDF compression.

Compression modes — Options for both lossless and lossy compression, with a sophisticated pattern matching and substitution engine to minimize undesired substitutions.

How does the library enhance PDF document compression?

The GdPicture.NET JBIG2 library integrates the JBIG2Decode filter into PDF documents, replacing less efficient compression methods like CCITTFaxDecode. This integration results in significantly reduced PDF file sizes without compromising image quality.

Is the JBIG2 compression suitable for all types of documents?

JBIG2 compression is specifically designed for bi-level (black and white) images, making it ideal for documents such as scanned text, line art, and technical drawings. While it offers both lossless and lossy modes, careful consideration is necessary when using lossy compression, as it may lead to unexpected substitutions in sensitive data.

What platforms and programming environments are compatible with the GdPicture.NET JBIG2 library?

The library is designed for cross-platform deployment, supporting:

Development environments — Compatible with .NET applications, including WinForms, WPF, ASP.NET, and COM/ActiveX components.

Operating systems — Windows (32-bit, 64-bit, and AnyCPU), Linux x86-64, Linux ARM-64, and macOS Universal (Intel and M series CPU based).

Frameworks — .NET Framework 4.5 and higher, .NET Core 3.1, and .NET 5.0 or higher.

60-day free trial

Try GdPicture.NET now!