Skip to content

Saving an image with mode "P" (palette) as TIFF saves a corrupted palette #1147

@vashek

Description

@vashek

Pillow (or the built-in libtiff) corrupts the palette when saving a mode P image as TIFF.
I have Pillow-2.7.0-py2.7.egg and Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32.
Simply opening an existing mode P image and saving it as TIFF will exhibit the problem. The first band (R) of the palette seems OK and the G and B bands are garbage. When I use compression="raw" (and therefore libtiff is not used), the palette is OK.
May be related to #718 but I don't get any exception, the original image in memory is OK (only the saved one is corrupted) and the length doesn't change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAny unexpected behavior, until confirmed feature.TIFF

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions