Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #5335, that states that the "compression" list at https://pillow.readthedocs.io/en/latest/handbook/image-file-formats.html#saving-tiff-images is incorrect.

I've added "tiff_lzw", "jpeg", "packbits", "lzma", "zstd" and "webp" from

COMPRESSION_INFO = {
# Compression => pil compression name
1: "raw",
2: "tiff_ccitt",
3: "group3",
4: "group4",
5: "tiff_lzw",
6: "tiff_jpeg", # obsolete
7: "jpeg",
8: "tiff_adobe_deflate",
32771: "tiff_raw_16", # 16-bit padding
32773: "packbits",
32809: "tiff_thunderscan",
32946: "tiff_deflate",
34676: "tiff_sgilog",
34677: "tiff_sgilog24",
34925: "lzma",
50000: "zstd",
50001: "webp",
}

and removed "tiff_jpeg" (since it is obsolete, see #4627, let's stop advertising it).

@hugovk
Copy link
Member

hugovk commented Mar 17, 2021

If there's no special meaning in the order, let's alphabetise them for ease of reference.

@radarhere
Copy link
Member Author

Ok, done

@kmilos
Copy link
Contributor

kmilos commented Mar 17, 2021

Just out of curiosity, any reason for the tiff_ prefix while you're at it? I don't think there's anything TIFF specific about lzw, deflate, etc...

@radarhere
Copy link
Member Author

At this point, backwards compatibility? PIL had some with the tiff_ prefix and some without, and I guess #268 and #3555 just went different ways on this.

I've added a commit removing tiff_deflate from the list, as suggested in #5335 (comment)

@hugovk hugovk merged commit 4da2fb3 into python-pillow:master Mar 19, 2021
@radarhere radarhere deleted the compression branch March 19, 2021 07:02
@kmilos
Copy link
Contributor

kmilos commented Mar 19, 2021

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify saving LZW-compressed TIFFs in the documentation

3 participants