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
Added support for PPM arbitrary maxval #6119
Conversation
fefce6a
to
0cbeac6
Compare
Tests/test_file_ppm.py
Outdated
assert im.get_format_mimetype() == "image/x-portable-pixmap" | ||
|
||
|
||
def test_arbitrary_maxval(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these mode be parametrised? Looks like one input bytestring and two things to assert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Resolves #5008
Resolves #5403
#5008 points out that the PPM
maxval
does not just indicate the bit depth of an image. It is an arbitrary number, that "Must be less than 65536 and more than zero."The example from the issue has a
maxval
of 11 (not 2 ** 11, but just 11), and https://en.wikipedia.org/wiki/Netpbm#PGM_example shows an example where themaxval
is 15. So when it is 15, the values range between 0 and 15, from black to white.This PR