Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Convert all images in folder to jpg python

from PIL import Image 
import os 

path = r'C:Usersdavid.hanDesktopCOPY_images_files'

for file in os.listdir(path): 
    if file.endswith(".jpg"): 
        img = Image.open(file)
        file_name, file_ext = os.path.splitext(file)
        img.save('/png/{}.png'.format(file_name))
Comment

PREVIOUS NEXT
Code Example
Python :: from django.contrib import messages 
Python :: get context data django 
Python :: python all lowercase letters 
Python :: progressbar time in python 
Python :: flask python use specified port 
Python :: pil img to pdf 
Python :: how to simplify fraction in python 
Python :: pip in vscode linux 
Python :: get number of zero is a row pandas 
Python :: python find smallest value in 2d list 
Python :: django static files 
Python :: create log in python 
Python :: calculate distance in python 
Python :: how to calculate z score in python 
Python :: setting urls 
Python :: python gui drag and drop 
Python :: pd df append 
Python :: python dataframe row count 
Python :: pyqt open file dialog 
Python :: python how to get the folder name of a file 
Python :: fill nan values with mean 
Python :: matplotlib dateformatter x axis 
Python :: twitter api v2 python tweepy 
Python :: how to get the author on discord.py 
Python :: how to auto install geckodriver in selenium python with .install() 
Python :: how to iterate through a list in python 
Python :: how to write in a text file python 
Python :: square root python 
Python :: generate dates between two dates python 
Python :: python partial 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =