SIPS Command: Scriptable Image Processing System in macOS
SS64
macOS
How-to
sips
Scriptable Image Processing System. sips is used to query or modify raster image files (JPG/GIF/PNG) and ColorSync ICC<br>profiles. Image processing options include flip, rotate, change image format/width/height. Its functionality can also be used through the "Image Events" AppleScript suite.
Syntax<br>sips [image-query-functions] imagefile ...
sips [profile-query-functions] profile ...
sips [image-modification-functions] imagefile ...<br>[--out result-file-or-dir]
sips [profile-modification-functions] profile ...<br>[--out result-file-or-dir]
sips [-h, --help]
sips [-H, --helpProperties]
Functions
Profile query functions:
-g key<br>--getProperty key<br>Output the property value for key to STDOUT.
-X tag tagFile<br>--extractTag tag tagFile<br>Write a profile tag element to tagFile.
-v<br>--verify<br>Verify any profile problems and log output to STDOUT.
Image query functions:
-g key<br>--getProperty key<br>Output the property value for key to STDOUT.
-x profile<br>--extractProfile profile<br>Get the embedded profile from image and write it to profile.
Profile modification functions:
-s key value<br>--setProperty key value<br>Set a property value for key to value.
-d key<br>--deleteProperty key<br>Remove a property value for key.
--deleteTag tag<br>Remove the tag element from a profile.
--copyTag srcTag dstTag<br>Copy the srcTag element of a profile to dstTag.
--loadTag tag tagFile<br>Set the tag element of a profile to the contents of tagFile.
--repair<br>Repair any profile problems and log output to STDOUT.
Image modification functions:
-s key value<br>--setProperty key value<br>Set a property value for key to value.
-d key<br>--deleteProperty key<br>Remove a property value for key.
-e profile<br>--embedProfile profile<br>Embed profile in image.
-E profile<br>--embedProfileIfNone profile<br>Embed profile in image only if image doesn’t have a profile.
-m profile<br>--matchTo profile<br>Colour match image to profile.
-M profile intent<br>--matchToWithIntent profile intent<br>Colour match image to profile with rendering intent:<br>perceptual | relative | saturation | absolute.
--deleteColorManagementProperties<br>Delete colour management properties in TIFF, PNG, and EXIF dictionaries.
-r degreesCW<br>--rotate degreesCW<br>Rotate the image by the specified degrees.
-f horizontal|vertical<br>--flip horizontal|vertical<br>Flip the image either vertically left to right, or horizontally top to bottom.
-c pixelsH pixelsW<br>--cropToHeightWidth pixelsH pixelsW<br>Crop image to fit specified size.
-p pixelsH pixelsW<br>--padToHeightWidth pixelsH pixelsW<br>Pad image with pixels to fit specified size.
--padColor hexcolor<br>Use this colour when padding. White=FFFFFF, Red=FF0000,<br>Default=Black=000000
-z pixelsH pixelsW<br>--resampleHeightWidth pixelsH pixelsW<br>Resample image at specified size. Image apsect ratio may be altered.
--resampleWidth pixelsW<br>Resample image to specified width.
--resampleHeight pixelsH<br>Resample image to specified height.
-Z pixelsWH<br>--resampleHeightWidthMax pixelsWH<br>Resample image so height and width aren’t greater than specified size.
-i<br>--addIcon<br>Add a Finder icon to image file.
Options
The commands --getProperty, --setProperty, and --deleteProperty can use one of<br>the following keys as a parameter:
Special property keys:<br>all binary data<br>allxml binary data
Image property keys:<br>dpiHeight float<br>dpiWidth float<br>pixelHeight integer (read-only)<br>pixelWidth integer (read-only)<br>typeIdentifier string (read-only)<br>format string [ jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga ]<br>formatOptions string default | [ low | normal | high | best percent] | [ lzw | packbits ]<br>space string (read-only)<br>samplesPerPixel integer (read-only)<br>bitsPerSample integer (read-only)<br>creation string (read-only)<br>make string<br>model string<br>software string (read-only)<br>description string<br>copyright string<br>artist string<br>profile binary data<br>hasAlpha boolean (read-only)
Profile property keys:<br>description utf8 string<br>size integer (read-only)<br>cmm string<br>version string<br>class string (read-only)<br>space string (read-only)<br>pcs string (read-only)<br>creation string<br>platform string<br>quality string [ normal | draft | best ]<br>deviceManufacturer string<br>deviceModel integer<br>deviceAttributes0 integer<br>deviceAttributes1 integer<br>renderingIntent string [ perceptual | relative | saturation | absolute ]<br>creator string<br>copyright string<br>md5 string (read-only)<br>Files
Your personal ICC profiles are stored in the folder:
HDname/users/username/Library/Colorsync/Profiles
or ~/Library/Colorsync/Profiles
There are also system wide copies under:
HDname/Library/Colorsync/Profiles
Press the Option/Alt key to reveal the library folder in Apple finder.
Examples
Convert a jpeg image into a .png image:
$ sips -s format png oldpic.jpg --out newpic.png
Convert a folder filled with .jpgs to .pngs:
$ for fi in *.jpg; do sips -s format png $fi --out $fi.png; done
Convert a folder filled with raw .RAF images . to .jpgs:
$ for f in *.RAF; do sips -s format jpeg $f...