Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to save an image with the same name after editing in python pillow module

import os
from PIL import Image

PATH = "F:FYP DATASETimagesoutliers DatasetNot Outliers"
Copy_to_path="F:FYP DATASETimagesoutliers 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') 
Comment

PREVIOUS NEXT
Code Example
Python :: Converting Hex to RGB value in Python 
Python :: hex to rgb python 
Python :: from django.contrib import messages 
Python :: make a white image numpy 
Python :: python break for loop 
Python :: pymupdf extract all text from pdf 
Python :: python private 
Python :: difference between two dictionaries python 
Python :: add fonts to matplotlib from a particular location 
Python :: apply lambda with if 
Python :: python3 ngrok.py 
Python :: python delete value from dictionary 
Python :: pandas dataframe froms string 
Python :: python define an array of dictonary 
Python :: install python altair 
Python :: unique_together what is used of it in django 
Python :: how do i turn a tensor into a numpy array 
Python :: hashing vs encryption vs encoding 
Python :: newsapi in python 
Python :: what does int do in python 
Python :: python to find the biggest among 3 numbers 
Python :: check how many times a substring appears in a string 
Python :: random search cv 
Python :: drop a list of index pandas 
Python :: python argparse file argument 
Python :: python find largest variable 
Python :: run flask in debug mode 
Python :: remove element from dictionary python 
Python :: python list fill nan 
Python :: python password with special characters 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =