### What did you do? Use `rounded_rectangle()` with radius bigger than half of the size with single corner enabled. ### What did you expect to happen? Draw correct corner arc without extra pixels. ### What actually happened? Visible *fill color* outside of the rounded rectangle. ### What are your OS, Python and Pillow versions? * OS: Linux (Debian Forky) * Python: 3.13.12 * Pillow: 12.2.0 ```text -------------------------------------------------------------------- Pillow 12.2.0 Python 3.13.12 (main, Feb 4 2026, 15:06:39) [GCC 15.2.0] -------------------------------------------------------------------- Python executable is /home/user/work/kodi/koframes/.venv/bin/python3 Environment Python files loaded from /home/user/work/kodi/koframes/.venv System Python files loaded from /usr -------------------------------------------------------------------- Python Pillow modules loaded from /home/user/work/kodi/koframes/.venv/lib/python3.13/site-packages/PIL Binary Pillow modules loaded from /home/user/work/kodi/koframes/.venv/lib/python3.13/site-packages/PIL -------------------------------------------------------------------- --- PIL CORE support ok, compiled for 12.2.0 --- TKINTER support ok, loaded 8.6 --- FREETYPE2 support ok, loaded 2.14.3 --- LITTLECMS2 support ok, loaded 2.18 --- WEBP support ok, loaded 1.6.0 --- AVIF support ok, loaded 1.4.1 --- JPEG support ok, compiled for libjpeg-turbo 3.1.4.1 --- OPENJPEG (JPEG2000) support ok, loaded 2.5.4 --- ZLIB (PNG/ZIP) support ok, loaded 1.3.1, compiled for zlib-ng 2.3.3 --- LIBTIFF support ok, loaded 4.7.1 --- RAQM (Bidirectional Text) support ok, loaded 0.10.3, fribidi 1.0.16, harfbuzz 13.2.1 *** LIBIMAGEQUANT (Quantization method) support not installed --- XCB (X protocol) support ok -------------------------------------------------------------------- ``` <!-- Please include **code** that reproduces the issue and whenever possible, an **image** that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive. The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as Plone, Django, or Buildout, try to replicate the issue just using Pillow. --> ```python from PIL import Image, ImageDraw def run(radius, file): mask = Image.new("L", (100, 100), 0) draw = ImageDraw.Draw(mask) draw.rounded_rectangle((0, 0, *mask.size), radius=radius, fill=128, outline=255, corners=(True, False, False, False)) mask.save(file) run(50, "ok.png") run(53, "looks_ok.png") run(54, "bug.png") run(75, "bug75.png") ``` `ok` and `looks_ok`: <img width="100" height="100" alt="Image" src="https://github.com/user-attachments/assets/3f61cceb-7825-4322-b148-98a4d5564c9e" /> <img width="100" height="100" alt="Image" src="https://github.com/user-attachments/assets/a0bcb56b-740d-40b6-85b8-5d8b1e6e8d2c" /> Bug: <img width="100" height="100" alt="Image" src="https://github.com/user-attachments/assets/5f9cddd3-54e2-4d38-870d-b0b6101302b8" /> Look at extra pixel the image top: <img width="120" height="35" alt="Image" src="https://github.com/user-attachments/assets/bb98bcff-105a-4f2f-a7b2-87ca63c0a1ca" /> Bigger radius makes more extra pixels (radius 75): <img width="100" height="100" alt="Image" src="https://github.com/user-attachments/assets/f75c858e-4bf6-45c5-a6af-983652440418" /> ## Summary I know radius bigger than 50% has no sense for two nearest corners (neighbors). But it seems have a sense for single (or diagonal) corners. If you want to disable those radii please update doc and maybe limit radius to half of the size in the code. ### CSS for compare #### Single corner ```css div { width: 100px; height: 100px; border-top-left-radius: 75px; background: red; } ``` <img width="106" height="106" alt="Image" src="https://github.com/user-attachments/assets/cbcd3eae-b26d-4279-a0e3-c83664eec0dd" /> #### Diagonal ```css div { border-top-left-radius: 75px; border-botom-right-radius: 75px; } ``` <img width="107" height="108" alt="Image" src="https://github.com/user-attachments/assets/4bffbb26-902f-47a5-8aba-a33dc851401b" /> #### Neighbors (limited to 50%) ```css div { border-top-left-radius: 75px; border-top-right-radius: 75px; } ``` <img width="106" height="103" alt="Image" src="https://github.com/user-attachments/assets/0aecde02-62e2-4f8b-b08f-1dc9586f43b4" />