Python PIL是否有抗锯齿方法? [英] Is there an antialiasing method for Python PIL?

查看:733
本文介绍了Python PIL是否有抗锯齿方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于PIL中的线条和椭圆,图像是粗糙的.​​

For lines and ellipses in PIL, the images are rough.

我发现只有在调整大小和缩略图时才具有抗锯齿功能.

I found antialiasing only in resize and thumbnail.

画线或椭圆时有什么方法可以进行抗锯齿吗?

Is there any way to do antialiasing when drawing a line or ellipse?

推荐答案

本地执行此操作的唯一方法是超级采样.以所需大小的倍数渲染图像,然后用filter=Image.ANTIALIAS resize渲染图像.

The only way to do it natively is with supersampling. Render your image at a multiple of the size you require, then resize it with filter=Image.ANTIALIAS.

这篇关于Python PIL是否有抗锯齿方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆