@snibgo: Thanks, that is a great suggestion.
I started off with a black/white PNG called bilevel-image.png
identify -verbose bilevel-image.pngImage: bilevel-image.png
Format: PNG (Portable Network Graphics)
Mime type: image/png
Class: PseudoClass
Geometry: 3100x4746+0+0
Units: Undefined
Colorspace: Gray
Type: Bilevel
Base type: Undefined
Endianess: Undefined
Depth: 8/1-bit
Channel depth:
gray: 1-bit
Colors: 2
Compression: Zip
I produced all the PDFs with the command:
for a in $(convert -list compress); do convert -compress $a bilevel-image.png bilevel-image-$a.pdf; doneand then checked the compression used by the PDF and added the PDF's size for comparison.
- Code: Select all
B44A /RunLengthDecode 757266
B44 /RunLengthDecode 757264
BZip /RunLengthDecode 757266
DXT1 /RunLengthDecode 757266
DXT3 /RunLengthDecode 757266
DXT5 /RunLengthDecode 757266
Fax /CCITTFaxDecode 98604
Group4 /CCITTFaxDecode 98610
JBIG1 /RunLengthDecode 757268
JBIG2 /RunLengthDecode 757268
JPEG2000 /JPXDecode 2067778
JPEG /DCTDecode 2436412
LosslessJPEG /RunLengthDecode 757282
Lossless /RunLengthDecode 757274
LZMA /RunLengthDecode 757266
LZW /LZWDecode 325225
None /ASCII85Decode 17038912
Piz /RunLengthDecode 757264
Pxr24 /RunLengthDecode 757268
RLE /RunLengthDecode 757264
RunlengthEncoded /RunLengthDecode 757290
WebP /RunLengthDecode 757266
ZipS /RunLengthDecode 757266
Zip /FlateDecode 311026
Zstd /RunLengthDecode 757266
/RunLengthDecode is clearly the default, used when the desired compression cannot be.
JBIG2 /RunLengthDecode 757268
probably means that the JBIG2 libraries are not available.
Generally JBIG2 gives by far the best bilevel compression.