mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-31 07:39:08 +00:00
pdfcraft_filters::encode_jbig2_generic writes 1-bit rows as a JBIG2 stream for JBIG2Decode (embedded organisation: a page information segment and an immediate lossless generic region, no globals): template 0 with its nominal AT pixels, typical prediction, and the MQ arithmetic coder (mq.rs), written from the JBIG committee's ISO/IEC 14492 Final Committee Draft. The coder reproduces its Annex H.2 test sequence byte for byte; output round-trips through hayro-jbig2, and Poppler renders it the same as the original. The optimizer's Monochrome Images gets JBIG2 (lossless) beside CCITT Group 4 (still the default), doc_optimize mono jbig2; a document below PDF 1.4 gets /Version /1.4 in its catalog. On 300 dpi text JBIG2 is about a third smaller than Group 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BfMGHQNgdq5yf5tKZHGR3z