mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-31 15:49:36 +00:00
Monochrome Images only took eight-bit grey of only black and white besides 1-bit images, so the same scan written as RGB, or as an indexed image of two palette entries, stayed at eight bits (and RGB went to the colour settings, as JPEG). Now these are packed to one bit first: - eight-bit DeviceRGB whose every pixel is black or white becomes DeviceGray; a decode array the same for each component becomes that pair, another stops it. Calibrated RGB and RGB with a profile stay. - an indexed image of 2, 4 or 8 bits that uses only palette entries 0 and 1 keeps its palette, whatever the two colours; a decode array other than the default stops it. Colour-key masks still stop all of them, and Retain leaves them to the grey and colour settings. They are decoded through /DecodeParms given by reference too (Document::with_direct_parms), and when downsampled a tie goes to the dark sample of the image as packed: packed RGB is grey, with grey's decode pair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BfMGHQNgdq5yf5tKZHGR3z