Skip to content

Instantly share code, notes, and snippets.

@go4Mor4
Created June 5, 2020 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save go4Mor4/72dab2d2dfde2d57d60819c83887563d to your computer and use it in GitHub Desktop.
Save go4Mor4/72dab2d2dfde2d57d60819c83887563d to your computer and use it in GitHub Desktop.
def resize_images(PATH, size):
images = [name for name in os.listdir(PATH) if os.path.isfile(os.path.join(PATH, name))]
for i in images:
image = Image.open(PATH+i)
image.thumbnail((size, size))
image.save(PATH+i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment