[Bash]: Resize multiple images on terminal

bash

12/28/2019


resize img 1

I ran into situation where I've had multiple screenshot images that were larger than necessary. Here is how you can conveniently resize multiple images that may take up less space on your PC storage with bash command.

Caveat

It may be a good practice to leave the original files in case they're needed in the future.

On terminal

TEXT
sips -Z 600 *.png
  • sips: image processing system
  • -Z: maintains the images' ratio
  • 600: maximum width of the image that you'd like to convert to
  • *.png: selects all the files in the directory that has an extension of png

Another example

TEXT
sips -z [height] [width] *.png
  • It resizes the images to specified dimensions that can alter the aspect ratio of the image

Result

46 images (6.6MB) were converted to 4MB

resize img 2


WRITTEN BY

Keeping a record