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 ImageDraw rounded_rectangle method #5208
Conversation
dfc4265
to
16087b2
Compare
1d17c8d
to
16fe3a9
Compare
16fe3a9
to
e340319
Compare
+1 for this PR, I like the idea. If it's not too slow I think we will use it in our YOLOv5 repo, as then we can achieve uniformity with our iOS app rectangles with rounded corners. |
e340319
to
d1757e3
Compare
Please could you add this to the release notes? |
docs/reference/ImageDraw.rst
Outdated
:param fill: Color to use for the fill. | ||
:param width: The line width, in pixels. | ||
|
||
.. versionadded:: 8.2.0 |
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.
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, 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.
Did this get missed in the rebase?
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.
I don't believe so. I suspect if you refresh https://pillow--5208.org.readthedocs.build/en/5208/reference/ImageDraw.html again, it will work.
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.
c8dec79
to
9ce3eba
Compare
Ok, I've added release notes. |
Resolves #4765 by adding
rounded_rectangle()
.Like
rectangle()
,except with a
radius
argumentIn this implementation, I limit the radius of the corners so that it is not greater than half of the width or the height - so a rounded rectangle might be a circle, but not another ellipse.