以改善圆形缩略图的图像质量

问题描述 投票:0回答:1

[How do I generate circular thumbnails with PIL?显示了制作圆形缩略图的方法。

跟随示例,我正在使用a picture here,这是生成的内容。

enter image description here

生成的图像质量看起来不太好,我想改善它,所以稍微改变最后一行:

from PIL import Image, ImageOps

mask = Image.open('mask.png').convert('L')
im = Image.open('image.png')

output = ImageOps.fit(im, mask.size, centering=(0.5, 0.5))
output.putalpha(mask)

output.save('output.png', dpi=(800,800))

但是图像质量似乎没有改善。

圈出圆圈后如何提高画质?谢谢。

python python-imaging-library thumbnails
1个回答
0
投票

尝试通过将例如method=Image.LANCZOS添加到.fit调用,尝试使用其他的下采样滤波器。

© www.soinside.com 2019 - 2024. All rights reserved.