Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for 2/4 bpp Tiff Grayscale Images #1789

Merged
merged 4 commits into from Apr 3, 2016

Conversation

zwhfly
Copy link
Contributor

@zwhfly zwhfly commented Mar 29, 2016

Including inverted and/or bit-order-reversed formats.

Taking 2bpp non-inverted reversed format as example, the term 'reversed' is interpreted as follows:
8 bits of a byte: MSB---> ABCDEFGH <---LSB
unpacks to:

pixel 0 value: MSB---> HGHGHGHG <---LSB
pixel 1 value: MSB---> FEFEFEFE <---LSB
pixel 2 value: MSB---> DCDCDCDC <---LSB
pixel 3 value: MSB---> BABABABA <---LSB

This interpretation is the same as the existing image processing tools that I've seen (ImageMagick and Windows Photo Viewer).

Sample pictures can be found here: Tests/images/tiff_gray_2_4_bpp/hopper*.tif

As seen in some tiff image files.
Refined the order of items in the dict 'OPEN_INFO'.
Added decoding support for 2/4 bit grayscale tiff images, including inverted and/or bit-order-reversed formats.
Including inverted and/or bit-order-reversed formats.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 76.958% when pulling 124bee0 on zwhfly:tiff into 4d234fb on python-pillow:master.

@wiredfool wiredfool merged commit 14f3b45 into python-pillow:master Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants