Using sips to batch-resize photos

Using man sips to get detailed manual.

     sips -- scriptable image processing system.

     sips [image-query-functions] imagefile ...
     sips [profile-query-functions] profile ...
     sips [image-modification-functions] imagefile ... [--out result-file-or-dir]
     sips [profile-modification-functions] profile ... [--out result-file-or-dir]

     This tool is used to query or modify raster image files and ColorSync ICC profiles.  Its functionality
     can also be used through the "Image Events" AppleScript suite.

Among the parameters, -z (-Z) can be used to resize images.

     -z pixelsH pixelsW
     --resampleHeightWidth pixelsH pixelsW
           Resample image at specified size. Image apsect ratio may be altered.

     --resampleWidth pixelsW
           Resample image to specified width.

     --resampleHeight pixelsH
           Resample image to specified height.

     -Z pixelsWH
     --resampleHeightWidthMax pixelsWH
           Resample image so height and width aren't greater than specified size.

For instance:

sips -Z 3000 *.jpg

to limit the largest to 3000.

Z. Lu avatar
Z. Lu
Data science, bioinfo, scripting, parasites, retro, plain text.
comments powered by Disqus