Python Forum

Full Version: Compressed multi page tiff
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm currently quite new to python but i'm finding my way pretty good and love the language more & more each day :)
but ... :) , i have currently an issue/problem where i can't find a decent solution for. I'm searching for a method to create a multipage tiff file from single page tiffs (which i found using PIL and the append_images method and which works fine) but the problem is that after creating that multipage tiff file the file size is drastically big (even too big tbh) that i would like to understand where this is coming from since the single images on themselves are quite small. The tiff single images have a jpeg compression and (as far as i can see using Preview on a mac) the multipage tiff also has this compression. I tried several methods (from the append_images/PIL method using their compression="jpeg" thing to using a conversion to a numpy array, ...) but nothing comes close to the actual result. Before i used python i've been using a toolkit called GDPicture and there the creation of the multipage tiff file (from the same source material) is going correct in terms of file size. But i need to have it in python so i'm desperately looking to find the solution :) I would like to add some of the single page tiffs but it is not allowed to attach them (so if you want/need them just give a shout on how i can deliver them).

Any help is much appreciated !
Thanks !
I have not used the package below that I am recommending you take a look at, so can't say for sure it will be of help, but it has a method named tifftools.split which at least sounds promising, so worth your checking out:

package:
pypi: https://pypi.org/project/tifftools/
GitHub: https://github.com/DigitalSlideArchive/tifftools
I don't know the answer, but if imagemagick can do it, one of the python wrappers such as wand should be able to do it as well.