Problem with PIL and compression format
Jeff Shannon
jeff at ccvcorp.com
Fri Apr 12 13:58:42 EDT 2002
In article <mailman.1018602385.24023.python-list at python.org>,
maric.michaud at cirec.com says...
> I tried ro include tif image in a pdf document with reportlab and Python
> 2.0, PIL 1.1.3.
> This work pretty well with uncompressed and 'Pack Bits" compressed TIFF
> files, but not with "CCITT group 4" that I need.
> Anyone has a suggestion for this ?
The problem here is that PIL doesn't include a codec for CCITT4
compression. (It's been asked for before, with no luck yet -- I
imagine that /F has his hands full with more important things.
And considering what we've paid for PIL, I'd hardly feel right
about complaining... ;) )
The only two solutions to this would be to 1) write your own
codec (possibly submitting it as a patch to PIL ;) ) or else 2)
find some other program/library to decode the CCITT4 images,
possibly converting them into a different format/compression
scheme. (A possible third solution might be to pay for Secret
Labs to develop and add this, themselves, but I don't expect
that's very practical...)
I'm using wxPython to read CCITT4 TIFFs, but I don't know if it's
practical to use it for *just* that purpose (I'm handling them as
part of a GUI app anyhow). There's also a number of external
programs that you could use to batch-convert your TIFFs to some
other format. (ImageMagick?)
--
Jeff Shannon
Technician/Programmer
Credit International
More information about the Python-list
mailing list