[reportlab-users] Optimizing greyscale and bilevel images

Robin Becker robin at reportlab.com
Thu Dec 29 04:42:48 EST 2011


On 28/12/2011 23:00, Jesus Cea wrote:

> -----BEGIN PGP SIGNED MESSAGE-----

> Hash: SHA1

>

> Checking pdfgen/pdfimages.py, grayscale JPEG files are detected and

> used, but any other imagefile is converted to RGB.

>

> I have bilevel PNG files that when printed as PDF using reportlab are

> expanded THREE times.

>

> Seems quite trivial to detect "1", "L" and indexed files in PIL

> images, and generate optimized representation. Supporting "1" or "L"

> natively seems to be 5 lines of code or less.

>

> Are you interested in a patch?.

>

> Grayscale seems trivial. Bilevel seems easy. Indexed... I am not

> familiar with PDF format, and reading the spec it is not very clear to

> me how to do it, beside the ability of PDF supporting this.

>

> PS: I am using ReportLab 2.4.

.........

by all means donate a patch.
--
Robin Becker


More information about the reportlab-users mailing list