简体   繁体   English

PIL image。旋转透明

[英]PIL image.rotate with transparency

Is there any way to rotate RGBA image, that the result will be smoother. 有什么方法可以旋转RGBA图像,结果将更平滑。 在此处输入图片说明

I mean, the bottom stop sign is the original image, the top is rotate by (PIL): 我的意思是,底部的停车标志是原始图像,顶部的是按(PIL)旋转:

img.rotate(angle)

Is there other build in function for it? 是否还有其他内置功能?

在此处输入图片说明

top left: 左上方:

img.rotate(angle, resample=Image.BILINEAR, expand=True)

top right: 右上:

img.rotate(angle, resample=Image.BICUBIC, expand=True)

bottom original. 最底下的原件。

based on @Dinesh comment 基于@Dinesh评论

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM