An Alfred workflow for quick image manipulation using ImageMagick. Crop whitespace, create square images, and remove white backgrounds from your image files.
- Alfred 4+ with Powerpack (required for List Filter functionality)
- ImageMagick - Install with
brew install imagemagick
Note: Without Powerpack, you can use the standalone scripts directly (see Development section).
- Download the
.alfredworkflowfile - Double-click to install in Alfred
- Ensure ImageMagick is accessible via
magickcommand
- Crop Whitespace: Removes surrounding whitespace (5% fuzz factor)
- Crop Whitespace + Square: Crops whitespace then pads to perfect square
Demo:
Original: [Image with lots of whitespace around content]
Crop: [Content tightly cropped, no whitespace]
Square: [Content centered in perfect square]
- Removes white backgrounds and converts to transparent PNG
- Uses 10% fuzz factor for intelligent detection
- Trims to tight bounds around the subject
Demo:
Original: [Image with white background]
Result: [Image with transparent background, tight bounds]
All operations automatically copy results to clipboard.
- Select an image file in Finder
- Right-click and choose from Services:
- "Make TightLayout" → Choose crop or crop+square
- "Remove Background" → Remove white background
PNG, JPEG, GIF, TIFF, HEIC, SVG
- Target Folder: Where to save processed images (defaults to source location)
- Image Suffix: Add suffix to processed filenames
- Open/Reveal: Choose post-processing action (open, reveal, both, ask, or nothing)
- TightLayout: Creates
_croppedand_squaredvariants - Background Removal: Creates
_no_bg.pngwith transparency
brew install imagemagick
magick --version # Verify installation- Grant Alfred full disk access in System Preferences
- Ensure target folder is writable
chmod +x tight-square.sh remove-white-bg.sh
# Crop whitespace
./tight-square.sh crop /path/to/image.png
# Crop and make square
./tight-square.sh crop_square /path/to/image.png
# Remove background
./remove-white-bg.sh /path/to/image.pngMIT License - see LICENSE file.
Inspired by @Acidham/alfred-image-shrinker - an excellent Alfred workflow for image optimization and resizing.
