ChaosPredictor
ChaosPredictor

Reputation: 4051

PIL image.rotate with transparency

Is there any way to rotate RGBA image, that the result will be smoother. enter image description here

I mean, the bottom stop sign is the original image, the top is rotate by (PIL):

img.rotate(angle)

Is there other build in function for it?

Upvotes: 0

Views: 800

Answers (1)

ChaosPredictor
ChaosPredictor

Reputation: 4051

enter image description here

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

Upvotes: 1

Related Questions