sips
Updated: September 28, 2024
Sips is used to query or modify raster image files and colorsync ICC profiles.
– scriptable image processing system.
USE CASES
# resizes images to 640px and places them in Medium Folder (keeps aspect ratio)
sips -Z 640 *.jpg --out ~/Desktop/Medium
# resize to specified H x W
sips -z 620 840 *.jpg -out ~/Desktop/Medium
# converts batch jpg to png and places in Converted Folder
for i in *.jpg; do sips -s format png $i -out ~/Desktop/Converted/$i.png;done
# convert a single image
sips -s format [image type] [file name] --out [output file]
sips -s format png test.jpg --out test.png
# rotate 90 degrees clockwise (default)
sips -r 90 image.jpg
# flip any image vertically or horizontally
sips -f horizontal image.jpg
sips -f vertical image.jpg
# change file ending of all files in directory
for i in *; do mv "$i" "$i.txt"; done
RENAME RESIZED PHOTOS
find . -type -f -exec bash -c 'mv "$0" "${0%\.jpg}-640.jpg"' {} \;