Python/PIL affine transformation

前端 未结 4 1925
庸人自扰
庸人自扰 2020-12-08 05:40

This is a basic transform question in PIL. I\'ve tried at least a couple of times in the past few years to implement this correctly and it seems there is something I don\'t

4条回答
  •  一整个雨季
    2020-12-08 05:58

    I think this should answer your question.

    If not, you should could consider that affine transformations could be concatenated into another transformation.

    So you could split your desired operation into:

    1. Moving the orgin to center of the image

    2. Rotating

    3. Moving the origin back

    4. Resizing

    You could than compute a single transformation out this.

提交回复
热议问题