Last active
September 13, 2024 20:16
-
-
Save aspose-com-kb/76bf3ac5b80bc74eaccf8de217b068a2 to your computer and use it in GitHub Desktop.
Rotate Image in Python. For more details: https://kb.aspose.com/imaging/python/rotate-image-in-python/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aspose.imaging | |
from aspose.imaging import Image, RotateFlipType | |
import os | |
path = "C://SampleFiles//" | |
license = aspose.imaging.License() | |
license.set_license(path + "License.lic") | |
# Rotate, flip and save to the output file. | |
with Image.load(os.path.join(path, "grayscaled.jpg")) as image: | |
image.rotate_flip(RotateFlipType.ROTATE_90_FLIP_NONE) | |
image.save(os.path.join(path, f"rotate90.png")) | |
print("Image Rotated Successfully") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment