Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash script for resize and set quality to jpg images (works with sips on Mac OSX)
#!/bin/bash
for file in *.jpg
do
sips --resampleHeightWidthMax 1357 --setProperty formatOptions 80 $file
done;
@Integralist

This comment has been minimized.

Copy link

Integralist commented Jan 25, 2018

Amazing! Thank you for sharing this

@gianpaj

This comment has been minimized.

Copy link

gianpaj commented Jun 3, 2018

you can also do:

sips --resampleHeightWidthMax 1357 --setProperty formatOptions 80 *.jpg
@trevorr

This comment has been minimized.

Copy link

trevorr commented Aug 28, 2019

With multiple subdirectories and spaces in filenames:

find . -name '*.jpg' -print0 | xargs -0 -L 1 sips --resampleHeightWidthMax 1357 --setProperty formatOptions 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.