How to preserve Image Quality when rotating with PIL

前端 未结 2 1245
自闭症患者
自闭症患者 2021-01-05 03:28

Basically I\'m trying to be able to rotate images via user interface, however I\'ve noticed that the image quality severely decreases upon each rotation. Does anyone know ho

2条回答
  •  被撕碎了的回忆
    2021-01-05 04:14

    An image is a grid of pixels. If you rotate it (and angle isn't a multiple of 90) the rotated grid must be rematched to a new non-rotated grid to display the image. Some loss can't be avoided in this process.

    Only option would be to keep the unrotated image somewhere and sum up the angles of multiple rotations and always build the rotated image from the initial unrotated one.

提交回复
热议问题