Pillow
Pillow copied to clipboard
Drawing methods edges aren't smooth
Originally posted by @radarhere in https://github.com/python-pillow/Pillow/issues/4895#issuecomment-1013763728
@DeusAres could you create a new issue with more detail?
In general the drawing methods don't have an antialiasing method, meaning that curves and lines that aren't straight are affected by pixelation:
I'm asking if there will be an implemention, like kerneling the drawn figures with methods such gaussian blur and to apply antialiasing so super-sampling can be avoided
The way that I use to superSample is to resize N times (2<=N<=8) the width and height and resize it back with Image.ANTIALIAS resampling
Taking this image in account:
It's a simple circle using .ellipse()
method on a 1000x1000 canvas but the edges aren't smooth because of the pixelation. The bigger the figure the less it's noticeable of course but that isn't the way to solve the issue
have a try image.save(name, quality=100, subsampling=0)
Actually, I find this useful. If this is changed, can there be a toggle for this?
Can I bump this again? I edited the poor English I used to write this issue, maybe it's clearer now
have a try
image.save(name, quality=100, subsampling=0)
Doesn't work in this case. It's not an error or problem in the saving process, but more of a missing feature in the ImageDraw methods
@DeusAres there isn't an open PR for this, so no, there isn't any work currently in progress. But that doesn't mean that such a change would be rejected. Feel free to dive into the code and create a pull request.
@balt-is-you-and-shift could you elaborate on why you find this useful?