I want to rotate a jpg by a set number of degrees...
For tips on using "sips", (link)And link to smittytone's big bash script for batch processing image files (installed using homebrew).
You can manipulate images from the command line e.g.
sips --cropOffset 1000 1500 -c 2000 2000 IMG_4809.JPG
sips -r 359.5 --padColor FFFFFF TheBaily.jpgNudges the image 359.5 degrees clockwise (effectively 0.5 degrees anti-clockwise) and fills the empty space white (FFFFFF).
From Stackexchange (link) and the Apple man page for sips (old link, no longer active :-(.
For more tips on doing image editing on Macintosh OS X using the image editor... (link)
You can use the following to crop the images
And to bulk crop the images and copy to a folder called 'test'. The first two numbers are the offset zero in y x pixels. The second two numbers is the crop size in terms of height and width in pixels.
sips --cropOffset 1000 1500 -c 2000 2000 *.JPG --out test
I want to bulk resize images
(manual instructions courtesy of Birme.net - link)
Launch Terminal.
To resize a single image width "sample-image.jpg" into 1200px and save as "resized-image.jpg".
sips --resampleWidth 1200 sample-image.jpg --out resized-image.jpg
Or to restrict height, change --resampleWidth into --resampleHeight
sips --resampleHeight 1200 sample-image.jpg --out resized-image.jpg
To bulk resize multiple images, set the input image as a file name pattern, such as all jpg files: *.jpg. Before running the resizing code, create a target folder like resized to hold all the resized images.
sips --resampleHeight 1200 *.jpg --out resized
You can add additional parameters to set the compression quality of jpeg images like this:
sips -s formatOptions 80 --resampleHeight 1200 *.jpg --out resized
You can use this parameter convert all png files into jpeg files
sips -s format jpeg -s formatOptions 80 --resampleHeight 1200 *.png --out resized