mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-31 15:49:36 +00:00
pdfcraft_filters::encode_g4 encodes packed 1-bit rows as Group 4 (ITU-T T.6, /K -1) through the fax crate (MIT, already in the tree via tiff), with rows capped at 32,767 samples so its 16-bit positions can't overflow; round trips are checked against hayro-ccitt. The optimizer (Settings::mono, CCITT G4 by default, so Reduce File Size too) re-encodes a 1-bit image of one colour component, or an image mask, stored with no filter or general-purpose ones, when that is smaller as stored. The samples decode to the same bits, so colour space, decode array and masks stay. PDF Optimizer gets a Monochrome Images row and doc_optimize a mono option. optimize.mono-compression goes from planned to partial (JBIG2 and monochrome downsampling not yet). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BfMGHQNgdq5yf5tKZHGR3z