[Image-SIG] Saving TIFF

Fredrik Lundh fredrik@pythonware.com
Wed, 2 Jun 1999 10:28:11 +0200


> I have a problem when saving a TIFF Image with the PIL (version 0.3a1).
> The function 'save' saves an inverted image of the displayed image (with
> ImageTk.PhotoImage, mode "L").

the tiff module is known to be somewhat broken,
and it's currently being overhauled for the 1.0 final
release.

in the meantime, you can invert the image on the
way out:

    if im.mode == "L":
        # workaround for broken TIFF writer
        im.point(lambda i: 255-i).save("out.tif")
    else:
        im.save("out.tif")

</F>