You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def resize_and_save(filename, output_dir, size=SIZE):
"""Resize the image contained in filename and save it to the output_dir"""
image = Image.open(filename)
# Use bilinear interpolation instead of the default "nearest neighbor" method
image = image.resize((size, size), Image.BILINEAR)
image.save(os.path.join(output_dir, filename.split(os.sep)[-1]))
Activity
3a1b2c3 commentedon Jan 23, 2024
def resize_and_save(filename, output_dir, size=SIZE):
"""Resize the image contained in
filenameand save it to theoutput_dir"""image = Image.open(filename)
# Use bilinear interpolation instead of the default "nearest neighbor" method
image = image.resize((size, size), Image.BILINEAR)
image.save(os.path.join(output_dir, filename.split(os.sep)[-1]))