-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Is the ImageDraw.Draw.rectangle documentation wrong? #3597
Labels
Comments
I will note that there is no Pillow 5.4.7. Here is code to demonstrate your situation - from PIL import Image, ImageDraw
im = Image.new("RGB", (300, 300), "#fff")
d = ImageDraw.Draw(im)
d.rectangle((0, 0, 200, 20), "#000")
im.save("out.png") |
@radarhere that's what |
matkoniecz
added a commit
to matkoniecz/quick-beautiful
that referenced
this issue
Jan 28, 2019
workaround for python-pillow/Pillow#3597
radarhere
changed the title
Is the ImageDraw.Draw.rectangle documentation wrong, or am I just not reading it right?
Is the ImageDraw.Draw.rectangle documentation wrong?
Feb 1, 2019
Feel free to comment if you think otherwise, but I'm closing this is as a duplicate of #1668. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you do?
I read the documentation on
PIL.ImageDraw.Draw.rectangle
, which states:The second point is just outside the drawn rectangle.
(source: https://pillow.readthedocs.io/en/3.0.x/reference/ImageDraw.html )Then, I tried out drawing a rectangle of size
(0, 0, 200, 20)
What did you expect to happen?
A rectangle that starts at pixel 0 and ends before pixel 200, that is 0-199, with 200 pixels width, with 20 pixels height
What actually happened?
A 201x21 px rectangle, as if the ending point was just inside the rectangle (instead of outside as the docs say)
What are your OS, Python and Pillow versions?
PIL.PILLOW_VERSION
)# (don't have a minimal example right now)
The text was updated successfully, but these errors were encountered: