# Show all information: $ sips -g all /path/image.jpg
# Show some information: $ sips -g pixelWidth -g pixelHeight /path/image.jpg
# Modify size: $ sips -z 1024 1024 /path/image.jpg
# Change format: $ sips -s format jpeg example.HEIC –out example.jpg
# Rotate: $ sips -r 90 example.jpg
# Reverse: $ sips -f horizontal example
# Change resolution: $ sips -s dpiHeight 300 -s dpiWidth 300 example.jpg
# Change all jpg to png in the folder:
for fi in *.jpg; do sips -s format png $fi –out $fi.png; done
# Change all the png file to half the size:
#!/bin/bash
if [ $1 ]
then
echo Processing file $1;
else
find . -name “*.png” -print0 | while IFS= read -r -d ” file; do
echo Processing file “$file”;
sips -Z $(($(sips -g pixelWidth “$file” | cut -s -d ‘:’ -f 2 | cut -c 2-) / 2)) “$file” –out “$file” &> /dev/null
done
fi