IRONSOFTWAREHOME

Bitonal Compression Unexpected Results in C#

Curtis Chau
Curtis Chau
Updated: October 12, 2026

IronPDF 2026.10.1+ introduces opt-in bitonal compression, which converts eligible images to 1-bit CCITT Group 4 through AdvancedCompressionOptions on CompressAndSaveAs, covered in the PDF compression guide. Setting BitonalMode = Force can produce three symptoms: colour images turned black and white, scans that look softer than the original, or no change at all.

Why Are My Colour Images Black and White?

BitonalMode = Force thresholds every eligible image to pure black and white, whatever it contains: colour and continuous-tone detail are discarded and cannot be restored.

Fix: leave BitonalMode at Off for PDFs with colour or photographic images, and use Force only for scanned text, faxes and line art.

Why Does My Scan Look Softer Than the Original?

With only BitonalMode = Force set, BitonalResolutionDpi stays null and falls back to TargetImageDpi, which defaults to 150: a 300 DPI scan is downsampled to 150 DPI before thresholding.

Fix: set BitonalResolutionDpi to the scan's DPI, or set TargetImageDpi = null to threshold at the source resolution. Setting BitonalResolutionDpi to 0 does not keep the source resolution: it behaves like null.

var options = new AdvancedCompressionOptions();
options.BitonalMode = BitonalCompressionMode.Force;
options.BitonalResolutionDpi = 300; // Threshold at 300 DPI
pdf.CompressAndSaveAs("output.pdf", options);
C#

Why Did Bitonal Compression Change Nothing?

Bitonal compression skips an image without an error in these cases:

  • The CCITT result was not smaller: the image keeps its current encoding. The decision is made per image, so a document can come out partly converted
  • The image has a mask: an image with a soft, stencil or colour-key mask keeps its current encoding, and the mask is neither dropped nor flattened
  • The image is already 1-bit: existing CCITT and JBIG2 scans are left untouched
  • The PDF was compressed in memory: CompressPdfToBytes and CompressPdfToStream do not accept AdvancedCompressionOptions, so only CompressAndSaveAs can produce CCITT Group 4 output
Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 21,253,952Version:2026.10just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999