A small, composable command-line tool for macOS that wraps sips to perform basic image operations such as resizing, cropping, format conversion, and metadata stripping. Ideal for UI assets, icons, screenshots, and batch workflows.
- Resize images to exact dimensions or max dimension while preserving aspect ratio.
- Crop images to specific width and height (centered).
- Convert images between formats (PNG, JPG, etc.).
- Strip metadata (EXIF, GPS, IPTC) for privacy and smaller file size.
- Batch operations for folders.
- In-place editing with
--in-place. - Info command to inspect image dimensions and format.
- Copy the script to a directory in your
$PATH:
chmod +x imageTool
mkdir -p ~/bin
mv imageTool ~/bin/- Optional: add your man page:
mkdir -p ~/bin/man/man1
cp imageTool.1 ~/bin/man/man1/
export MANPATH="$HOME/bin/man:$MANPATH"
source ~/.zshrc- Test:
imageTool --help
man imageTool# Crop an image (overwrite input)
imageTool crop 984 984 image.png --in-place
# Resize an image
imageTool resize 1024 1024 input.png output.png
# Resize image preserving max dimension
imageTool resize-max 1024 photo.jpg --in-place
# Convert to PNG (overwrite input)
imageTool convert png photo.jpg --in-place
# Strip metadata from an image
imageTool strip-meta image.png --in-place
# Strip metadata from all images in a folder
imageTool batch-strip-meta ./assets
# Inspect an image
imageTool info image.png| Command | Arguments | Description | |
|---|---|---|---|
crop |
WIDTH HEIGHT input [output | --in-place] |
Center-crop an image to the specified width and height. Overwrites the input if --in-place is used. |
|
resize |
WIDTH HEIGHT input [output | --in-place] |
Resize an image to exact dimensions. Overwrites the input if --in-place is used. |
|
resize-max |
MAX input [output | --in-place] |
Resize the image so that neither width nor height exceeds MAX, preserving aspect ratio. Overwrites input if --in-place is used. |
|
convert |
FORMAT input [output | --in-place] |
Convert an image to another format (e.g., PNG, JPG). Overwrites input if --in-place is used. |
|
info |
image |
Display the image’s width, height, and format. | |
strip-meta |
image [output | --in-place] |
Remove all metadata (EXIF, GPS, IPTC) from the image. Overwrites input if --in-place is used. |
|
batch-strip-meta |
folder |
Remove metadata from all images in the specified folder. Overwrites each file in place. |
- macOS (tested on 10.4+)
sips(built-in)- Bash (default on macOS)