Skip to content

LZW compressed tif image not handled properly in Pillow #5015

@rashindrie

Description

@rashindrie

What did you do?

Attempted to read a LZW compressed image as follows:

from PIL import Image
import matplotlib.pyplot as plt

# read file
image = Image.open('test.tif')

# display file as image
plt.imshow(image)
plt.show()

The image was originally converted from .bif to .tif using the below tool and command:
Tool: Command Line Tool from https://www.openmicroscopy.org/bio-formats/

bfconvert -series 2 -compression LZW test.bif test.ome.tif

What did you expect to happen?

The image to be displayed as it is.
image

What actually happened?

The displayed image contains strips across it and is discolored.
image

What are your OS, Python and Pillow versions?

  • OS: Linux
  • Python: 3.7.4
  • Pillow: 7.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions