fritz-hh/OCRmyPDF — pull request #50 by jbarlow83 (2014-01-10 00:57:52+00:00)
Title: Generate smaller PDFs with monochrome and grayscale images where possible

Due to a known issue in reportlab, all PDFs were being generated with either JPEG compressed images or zipped raw RGB images, even if the input files were monochrome or grayscale. The patch is from reportlab's upstream.

Hope you don't mind the whitespace autoformatting in hocrTransform.py.

After these changes, my test monochrome image went from a 4 MB PDF/A to 300 KB.

Modified ocrPage.sh to ask for a monochrome image whenever possible, by checking the bit depth as well as colorspace.