1from PIL import Image
2
3#read the image
4im = Image.open("sample-image.png")
5
6#show image
7im.show()
1from PIL import Image, ImageFilter # importing the image
2
3#Image -1 DLC3 with Blur filter
4img1 = Image.open('dlc3.jpg')
5filtered_img1 = img1.filter(ImageFilter.BLUR)
6filtered_img1.save('Blurdlc3.png')
7
8#Image -2 DYONISOS with Smooth filter
9img2 = Image.open('dyonisos.jpg')
10filtered_img2 = img2.filter(ImageFilter.SMOOTH)
11filtered_img2.save('dyonisossmooth.png')
12
13#Image - 3 SHARK with convert and rotate properties
14img3 = Image.open('shark.jpg')
15filtered_img3 = img3.convert('L')
16filtered_img3.rotate(180)
17filtered_img3.save('Shark.jpg')
1import urllib.request
2from random import *
3import random,string
4from selenium import webdriver
5
6try:
7 Image1 = driver.find_element_by_xpath('//*[@id="ivLargeImage"]/img').get_attribute('src')
8 len1 = 10 #Will be the number of characters in image name
9 letters1 = string.ascii_lowercase
10 img1_name = ''.join(random.choice(letters1) for i in range(len1)) #making random names here
11 full1_name = str(img1_name) + '.jpg'
12 file1_path = 'C:\Users\Cord\Desktop\\' + full1_name
13 urllib.request.urlretrieve(Image1,file1_path)
14except:
15 Image1 = 'No Image'
16 full1_name = 'No Image'
17 print(Image1)