Skip to content

Commit 66eb4fc

Browse files
committed
Update
1 parent 73c57b1 commit 66eb4fc

File tree

4 files changed

+72
-116
lines changed

4 files changed

+72
-116
lines changed

.idea/workspace.xml

Lines changed: 52 additions & 115 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

9_ImageManipulation/18_Pillow.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
# Install pip from here: https://pip.pypa.io/en/stable/installing/
22
# pip is a package manager. if you want to install library in Python, just run pip install <name-of-library>
3-
# Install Pillow from here: https://pypi.org/project/Pillow/
3+
# Install Pillow from here: https://pillow.readthedocs.io/en/latest/installation.html
44

55
from PIL import Image
66

7+
im = Image.open("image1.jpg")
8+
im.show()
9+
10+
im2 = Image.open("scooter.jpeg")
11+
im2.show()
12+
im2 = im2.rotate(55) # rotate the image by 55 degrees
13+
14+
# Now, let us resize the images.
15+
16+
def resize(image_names, new_size = (256, 256)):
17+
for im_name in image_names:
18+
img = Image.open(im_name)
19+
img = img.resize(new_size)
20+
img.save("rsz_"+im_name)
21+
22+
images = ['image1.jpg', 'scooter.jpeg']
23+
resize(images)
24+
25+

9_ImageManipulation/image1.jpg

78.6 KB
Loading

9_ImageManipulation/scooter.jpeg

27.6 KB
Loading

0 commit comments

Comments
 (0)