Skip to content

Instantly share code, notes, and snippets.

@psenger
Last active December 26, 2023 21:36
Show Gist options
  • Save psenger/77b40041f061950d279f5d83522a7625 to your computer and use it in GitHub Desktop.
Save psenger/77b40041f061950d279f5d83522a7625 to your computer and use it in GitHub Desktop.
[SIPS - scriptable image processing system] #MacOS #sips #Image

SIPS (Scriptable Image Processing System)

SIPS (Scriptable Image Processing System) is a command-line utility available on macOS that enables users to perform various image manipulation tasks directly from the command line. It supports a wide range of image file formats, including JPEG, PNG, TIFF, GIF, and more

Example usage:

  • Scale an image (without aspect ratio): sips -z width height input_image --out output_image
  • Scale an image (maintain aspect ratio): sips -z 800 0 original.jpg --out scaled.jpg
  • Query image properties: sips -g dpiHeight -g dpiWidth image.jpg
% sips -g dpiHeight -g dpiWidth  PosterArtWaterColorCanyon.jpg 
/tmp/PosterArtWaterColorCanyon.jpg
  dpiHeight: 72.000
  dpiWidth: 72.000
%
  • Change image format: sips -s format jpeg picture.png --out picture.jpg
  • Rotate image: sips --rotate 45 image.jpg --out rotated_image.jpg
  • Resize image: sips --resampleHeightWidth 1920 300 image.jpg --out resized_image.jpg
  • Crop image: sips --cropToHeightWidth 100 100 image.jpg --out cropped_image.jpg
  • Show help: sips -h or sips -H
  • Verify image: sips -v image.jpg
  • Extract embedded profile from image: sips -x profile image.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment