Handling Group4 TIFF images in python

╄→尐↘猪︶ㄣ 提交于 2019-11-28 08:24:31

问题


PIL doesn't natively support G4 images, is there some other python package that does? I need to read multi-page TIFF images and pull convert them into gif/png on the fly to serve up in a web page. (I'm not converting them all on the fly, but cherry picking them for display).

I've considered using ImageMagick which has that conversion ability, but I'd like to be able to reach into the TIFF files and see what is inside them for indexing.


回答1:


See this post about a patch against PIL, this project to wrap FreeImage, and this project to wrap libtiff.




回答2:


Using PythonMagick:

from PythonMagick import Image
Image('CCITT_4.TIF[0]').write("PNG8:CCITT_4.PNG")


来源:https://stackoverflow.com/questions/7034015/handling-group4-tiff-images-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!