我想旋转图像并保持边缘平滑。
原来是这样的
旋转后
我使用的代码看起来像
def rot_center(self, image, angle):
"""rotate an image while keeping its center and size"""
orig_rect = image.get_rect()
rot_image = pygame.transform.rotate(image, angle)
rot_rect = orig_rect.copy()
rot_rect.center = rot_image.get_rect().center
rot_image = rot_image.subsurface(rot_rect).copy()
return rot_image
我做错了什么吗?
最佳答案
尝试使用 pygame.transform.rotozoom标度为 1。
它表示已过滤,我认为这意味着 AA。
关于python - 图像在 Pygame 中旋转,同时保持平滑的边缘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13272023/