Menu

#116 Enable compression "tiff_lzw" in Pillow

v2.7.4.2
New
nobody
None
High
Defect
2014-09-26
2014-05-12
No

I am using WinPython-32bit-3.3.5.0.

With PIL's Image.save, the compression method "tiff_lzw" leaves the file uncompressed.

However, I found out:
The function _save in Pillow's tiffimageplugin.py has a list of libtiff-supported compression methods. When I add "tiff_lzw" there (or set WRITE_LIBTIFF = True), the saved image is successfully LZW-compressed!

Discussion

  • Robert Pollak

    Robert Pollak - 2014-05-13

    Maybe Pillow has not included "tiff_lzw" in this list because libtiff is not always compiled with LZW support?

    I have now found out that I can set TiffImagePlugin.WRITE_LIBTIFF = True in my code, so this ticket can be closed.

     

    Last edit: Robert Pollak 2014-05-13
  • Robert Pollak

    Robert Pollak - 2014-09-26

    Note that currently setting 'WRITE_LIBTIFF = True' disables custom TIFF tags.

     

Log in to post a comment.