使用 PIL/pillow 将 tiff (I;16) 转换为 JPG

Convert tiff (I;16) to JPG with PIL/pillow

我在将 tiff 图像从显微镜转换为 jpeg 时遇到问题,它应该在 Web 应用程序中显示。 我尝试了以下方法:

image = Image.open(file_name)
image.convert(mode="RGB")
image.save('my.jpeg')

>>IOError: cannot write mode I;16 as JPEG

任何人都有将 16 位 TIFF 文件转换为 jpeg 的经验... 我在下面链接了这样一个文件。 感谢您的帮助!

https://drive.google.com/open?id=0B04N02JqhWJOWjBPY1RRZkIwbTg

这是一个错误。这是一个解决方法:

import Image
image = Image.open("Fredy1_002.tif")
image.mode = 'I'
image.point(lambda i:i*(1./256)).convert('L').save('my.jpeg')