Skip to content

Sicxx211/JPGtoPNG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

JPG to PNG convertor

Why I wrote the code

I wrote this code for convenience, I could use the web to convert all of my files from JPG to PNG but sometimes it would just take too long to do it,just imagine if I had a folder with thousands of JPG images, it would take ages to do this conversion using the web, so I fixed this problem with this script, it's easy to use, not to complex, and fast.

How I wrote the code

image_folder = sys.argv[1]
output_folder = sys.argv[2]
if not os.path.exists(output_folder):
os.makedirs(output_folder)
for filename in os.listdir(image_folder):
img = Image.open(f'{image_folder}{filename}')
clean_name = os.path.splitext(filename)[0]
img.save(f'{output_folder}{clean_name}.png' , 'png')
print('all done!')

*Instance of running the code ->$ python3 pngconverter.py pokedex converted

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages