import Image
pip install pillow
from PIL import Image, ImageDraw
import Image
pip install pillow
from PIL import Image, ImageDraw
how to save an image with the same name after editing in python pillow module
import os
from PIL import Image
PATH = "F:\FYP DATASET\images\outliers Dataset\Not Outliers\"
Copy_to_path="F:\FYP DATASET\images\outliers Dataset\"
for filename in os.listdir(PATH):
img = Image.open(os.path.join(PATH, filename)) # images are color images
img = img.resize((224,224), Image.ANTIALIAS)
img.save(Copy_to_path+filename+'.jpeg')
python image
import urllib.request
from random import *
import random,string
from selenium import webdriver
try:
Image1 = driver.find_element_by_xpath('//*[@id="ivLargeImage"]/img').get_attribute('src')
len1 = 10 #Will be the number of characters in image name
letters1 = string.ascii_lowercase
img1_name = ''.join(random.choice(letters1) for i in range(len1)) #making random names here
full1_name = str(img1_name) + '.jpg'
file1_path = 'C:UsersCordDesktop\' + full1_name
urllib.request.urlretrieve(Image1,file1_path)
except:
Image1 = 'No Image'
full1_name = 'No Image'
print(Image1)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us