Skip to content
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

Gaps in ImageDraw arc #3499

Closed
radarhere opened this issue Dec 17, 2018 · 3 comments · Fixed by #3824
Closed

Gaps in ImageDraw arc #3499

radarhere opened this issue Dec 17, 2018 · 3 comments · Fixed by #3824

Comments

@radarhere
Copy link
Member

radarhere commented Dec 17, 2018

The following code is based on 'test_arc_width' - https://github.com/python-pillow/Pillow/blob/master/Tests/test_imagedraw.py#L105. It generates https://github.com/python-pillow/Pillow/blob/master/Tests/images/imagedraw_arc_width.png first, just for comparison, and then generates the attached image, which has gaps in the fill.

OS: macOS 10.14
Python: 3.7.1
Pillow: 5.3.0

from PIL import Image, ImageDraw

def drawArc(W, H, width, path):
	# Bounding box points
	X0 = int(W / 4)
	X1 = int(X0 * 3)
	Y0 = int(H / 4)
	Y1 = int(X0 * 3)

	# Two kinds of bounding box
	BBOX1 = [(X0, Y0), (X1, Y1)]

	im = Image.new("RGB", (W, H))
	draw = ImageDraw.Draw(im)
	draw.arc(BBOX1, 10, 260, width=width)
	im.save(path)

# Existing test
drawArc(100, 100, 5, 'imagedraw_arc_width.png')

# Problem image
drawArc(500, 500, 50, 'problem.png')

problem

@DevilXD
Copy link

DevilXD commented Jan 10, 2019

Just ran into the same issue. The width option seems to be undocumented too.

@radarhere
Copy link
Member Author

@DevilXD
Copy link

DevilXD commented Jan 10, 2019

Huh, not sure what docs I was looking at then... But yeah, I'm getting the same issue.
Found out this issue can be semi-repeated by drawing arcs in a for loop, shrinking the bounding box by one each time. Seems like this exact thing is happening internally when you use width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants