Last active
August 9, 2021 11:27
-
-
Save JuhaKiili/aedac41b745977ed07483f2a05a5762c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code works for: | |
# 1. Single image | |
# 2. List of images | |
# 3. An archive with images | |
# 4. List of archives | |
# 5. Mix of everything above | |
# Defined by list of: | |
# 1. Public URIs | |
# 2. Private data store URIs | |
# 3. Local file paths | |
for image_path in valohai.inputs("my-images").paths(): | |
# Do things per image | |
image = Image.open(image_path, mode="r") | |
image.thumbnail(size, Image.ANTIALIAS) | |
image.save(out_path, "JPEG") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment