Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#11 Adds support for grayscale and B/W inline PIL images

open
nobody
None
5
2004-01-29
2004-01-29
Joel Pearson
No

Currently, pdfimages.py converts all inline images to
RGB before embedding them into the PDF. Because I
frequently use multiple 1 bit inline images in
documents, both the CPU overhead of conversion and the
increased size of the created PDF are significant.

The attached diff uses PIL to see if the mode of the
image is 'L' (grayscale) or '1' (black and white). If
so, it embeds the image using the appropriate PDF
encoding scheme without converting it.

All other image modes (including RGB) are converted to
RGB and encoded as before.

This diff file also includes patches for request IDs
884721 ("global name sys not defined") and 887166
("print" in pdfimages.py causes CGI problems). Both of
these patches are specific to Reportlab v1.19.

Discussion

  • Joel Pearson
    Joel Pearson
    2004-01-29

    Patch to add grayscale and B/W inline PIL image support

     
    Attachments