/ / Python PIL-中心ではない点を中心に画像を回転させる-python、python-imaging-library

Python PIL - 中心ではない点を中心に画像を回転する - python、python-imaging-library

PILを使用して画像の中心ではない点を中心に画像を回転させることはできますか?

そうでない場合は、希望する動作を実現するために私に何をお勧めできますか?

回答:

回答№1は0

デフォルトでは、コメントの質問に答えるために、画像の中心を軸に回転します。それ以外の場合は、左上から座標を指定できます。

from PIL import Image
im = Image.new("RGB", (100, 100))
resultIm = im.rotate(45, center=(25, 25))

見る https://pillow.readthedocs.io/en/5.2.x/reference/Image.html#PIL.Image.Image.rotate ドキュメンテーションのために。