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

Drawn circle has torn edges #4895

Closed
kawka-maciej opened this issue Sep 1, 2020 · 13 comments
Closed

Drawn circle has torn edges #4895

kawka-maciej opened this issue Sep 1, 2020 · 13 comments

Comments

@kawka-maciej
Copy link

kawka-maciej commented Sep 1, 2020

What did you do?

Tried to draw a circle.

What did you expect to happen?

Be able to draw a nice, smooth circle using draw.ellipse().

What actually happened?

The circle is torn and the edges are bad quality. Did I do something wrong?
Screenshot 2020-09-01 at 18 51 11

What are your OS, Python and Pillow versions?

  • OS: Mac OS Catalina 10.15.6
  • Python: 3.6.7
  • Pillow: 7.2.0
from PIL import Image, ImageDraw

target = Image.new("RGB", (400,400), color=(255,255,255))

draw = ImageDraw.Draw(target)

draw.ellipse((50,50,250,250), fill=(0,0,0), outline=None, width=0)

target.save('circle.jpg')
@hugovk

This comment has been minimized.

@kawka-maciej

This comment has been minimized.

@nulano
Copy link
Contributor

nulano commented Sep 1, 2020

Just to be clear, the gray pixels around the outside of the ellipse are JPEG compression artefacts. Saving as PNG produces a slightly better image, but the circle is still not smooth.

@radarhere radarhere changed the title Drawn circle has torn edges. Drawn circle has torn edges Sep 1, 2020
@radarhere
Copy link
Member

Here is version of this image created by #4523
circle

@kawka-maciej
Copy link
Author

This one looks much nicer! Are there any plans when it will be released?

@kawka-maciej
Copy link
Author

Is there an easy way to build the .whl locally with the version from the PR? I tried reproducing multibuild pipeline inside a docker container but couldn't get it to work. The wheels that I'm building don't have required libraries (like the Pillow.libs that you get after installing it from pip).

@radarhere
Copy link
Member

Is this what you're after? Pillow-7.2.0.dev0-cp36-cp36m-macosx_10_10_x86_64.whl.zip

@kawka-maciej
Copy link
Author

Sorry for not being specific. I'm running Pillow inside AWS Lambda so I need a linux x86_64 whl. Can I ask where did you get it from?

@radarhere
Copy link
Member

Ah. I presumed you were in the same environment as your original post.

For the releases, Pillow has the pillow-wheels repository, which runs on https://travis-ci.org/. I can create a commit in my fork of pillow-wheels, that

  • checks out Pillow with the relevant commit
  • removes the Travis jobs that I'm not interested in
  • uploads the resulting wheel to https://www.file.io/

And the URL for the wheel is printed - https://travis-ci.org/github/radarhere/pillow-wheels/builds/724418755#L5539

@kawka-maciej
Copy link
Author

kawka-maciej commented Sep 5, 2020

Works perfectly, thank you very much for the explanation! Is there any way I could help with the #4523 issue so it could be merged?

@hugovk
Copy link
Member

hugovk commented Oct 11, 2020

#4523 has been merged and will be in next week's release.

@hugovk hugovk closed this as completed Oct 11, 2020
@DeusAres
Copy link

Can we reopen this? It would really need an antialiasing method. Super sampling is expensive

@radarhere
Copy link
Member

@DeusAres could you create a new issue with more detail?

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

No branches or pull requests

5 participants