blink1073 / tifffile

Deprecated: Read and write image data from and to TIFF files.
Other
60 stars 41 forks source link

How do I save Image using LZW compression? #20

Open artzers opened 7 years ago

artzers commented 7 years ago

Hello, I am using Windows Python3.6. I want to read, process some 3D tiff images and save them using LZW compression. I failed to install python libtiff, success installing tifffile. tifffile can read my 3D tiff images well. However I am wondering how to save tiff image using LZW.

I find the source code: elif compress: def compress(data, level=compress): return zlib.compress(data, level)

tifffile seems just using zlib compression. Please help me, thanks

artzers commented 7 years ago

@cgohlke We used to use LZW to save lossless compression tiff image. Losslessness is very important. So how to compress tiff image lossless using Zip or LZMA? For example , Zip compression require input value. 0 is noncompression and I do not need this. I wonder if I set 3 or 4 for Zip, whether the result tiff image is still lossless? Thank you.

artzers commented 7 years ago

@cgohlke So it means it is still lossless if I set value 2-9 for Zip compression? Well~~Otherwise it seems that there is no one developing libtiff for python 3.5 up to now. Thank you.

MeowMeowLady commented 5 years ago

Hi, did you solve the problem? I failed using lzw compression mode with tifffile too.

artzers commented 5 years ago

@MeowMeowLady No, I just use tifffile uncompress mode. There are no other python package which conclude LZW part.