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
This resizes an image to within a bounding box. Make the first parameter very large to just scale to height.
'''
def resize(filein, fileout, maxw, maxh):
im = pyvips.Image.new_from_file(filein, access="sequential")
out = pyvips.Image.thumbnail(filein, maxw, height=maxh)
out.write_to_file(fileout , Q=95)
'''
it uses the thumbnail thumbnail function of vips - which has a lot of features (and doesn't just make thumbnails)