-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
There is a problem in ImageDraw.ImageDraw.rounded_rectangle. There is no problem in code's logic. I'll share the code & error.
Code:
from PIL import Image, ImageDraw
board = Image.new("RGBA", (1000, 1000))
draw = ImageDraw.Draw(board)
draw.rounded_rectangle((0, 0, 50 * 2, 500), 50, fill="white", corners=(True, False, False, True))Error:
Traceback (most recent call last):
File "...\file.py", line 60, in <module>
draw.rounded_rectangle((0, 0, 50 * 2, 500), 50, "red", corners=(True, False, False, True))
File "...\.venv\Lib\site-packages\PIL\ImageDraw.py", line 508, in rounded_rectangle
self.draw.draw_rectangle((x0 + r + 1, y0, x1 - r - 1, y1), fill_ink, 1)
ValueError: x1 must be greater than or equal to x0If I don't pass the corners, it will work. If I don't pass the fill, it will work either as well! But I want them both and I can't use them here.
Metadata
Metadata
Assignees
Labels
No labels