Using TIFF G4 image in PIL

后端 未结 1 754
生来不讨喜
生来不讨喜 2021-01-26 23:49

I wrote a pure python TIFF G4 decompress for use with tifffile.py. I know there are ways to add libtiff to a custom PIL, but I never could get that wor

1条回答
  •  萌比男神i
    2021-01-27 00:02

    It appears that TiffImagePlugin does not easily allow me to hook in additional decompressors. Replacing TiffImageFile._decoder with a dictionary of decoders might work, but you would have to examine and test each release of PIL to ensure it hasn't broken. This level of maintenance is just as bad as a custom PIL. I appreciate the design of tifffile.py for using a dictionary of decoders. It made it very easy.

    Final solution? I couldn't hook my code into PIL. I had to use PIL.Image.fromarray() to using my decompressed images.

    0 讨论(0)
提交回复
热议问题