A fast, simple command-line tool to extract high-quality icons from macOS applications.
Found this tool helpful? Consider sponsoring the project to support ongoing development and maintenance. Your support helps keep Icon Grabber free and open source for everyone!
- macOS 15 (Sequoia) or later
- Simple & Fast - Extract icons with a single command
- Flexible Sizing - Get icons in any size from 16x16 to 1024x1024
- High Quality - Preserves original icon quality in PNG format
- File Size Optimization - Limit output file size using sips compression
- Scriptable - Perfect for automation and batch processing
- Native - Written in Swift, lightweight, no dependencies
Download the latest installer from Releases:
# Download the latest PKG installer
curl -LO $(curl -s https://api.github.com/repos/macadmins/icongrabber/releases/latest | grep "browser_download_url.*\.pkg" | cut -d '"' -f 4)
# Or if you know the latest version number, use:
# curl -LO https://github.com/macadmins/icongrabber/releases/latest/download/icongrabber-VERSION.pkg
# Install
sudo installer -pkg icongrabber-*.pkg -target /
# Verify installation
icongrabber --version# Clone the repository
git clone https://github.com/kitzy/icongrabber.git
cd icongrabber
# Build and install system-wide
make build
sudo make install
# Or install to your home directory (no sudo required)
make build
make install PREFIX=$HOME/.local
export PATH="$HOME/.local/bin:$PATH" # Add to ~/.zshrcExtract an icon in less than 30 seconds:
# Extract Safari's icon (creates Safari.png)
icongrabber /Applications/Safari.app
# Custom size
icongrabber /Applications/Safari.app -s 256
# Custom output location
icongrabber /Applications/Safari.app -o ~/Desktop/my-icon.png
# Limit file size to 100KB
icongrabber /Applications/Safari.app -m 100KB
# Limit file size to 2MB
icongrabber /Applications/Safari.app -m 2M
# Force overwrite existing file
icongrabber /Applications/Safari.app -fThat's it!
icongrabber <app-path> [options]| Option | Description | Example |
|---|---|---|
-s, --size <pixels> |
Icon size (default: 512) | -s 256 |
-o, --output <path> |
Output file path | -o icon.png |
-i, --input <path> |
Input app path (alternative) | -i /Applications/Safari.app |
-m, --max-file-size <size> |
Max file size (optimizes with sips) | -m 100KB or -m 2M |
-f, --force |
Overwrite existing files without prompting | -f |
-h, --help |
Show help message | -h |
-v, --version |
Show version | -v |
- 16x16 - Toolbar icons, favicons
- 32x32 - Small UI elements
- 64x64 - List views, thumbnails
- 128x128 - Standard app icons
- 256x256 - Retina displays
- 512x512 - High-resolution (default)
- 1024x1024 - Maximum quality
# Get Safari's icon at 512x512
icongrabber /Applications/Safari.app# Save to a specific location
icongrabber /Applications/Safari.app -o ~/Desktop/safari-icon.png# Get a 256x256 icon
icongrabber /Applications/Safari.app -s 256 -o small-icon.png# Extract icon and limit file size to 100KB (auto-selects 256x256)
icongrabber /Applications/Safari.app -m 100KB
# Limit to 2MB using shorthand (auto-selects 1024x1024)
icongrabber /Applications/Safari.app -m 2M
# Combine with custom size for better optimization (manual size selection)
icongrabber /Applications/Safari.app -s 256 -m 50K -o optimized.png# Extract multiple sizes for the same app
./examples/extract_multiple_sizes.sh /Applications/Safari.app# Extract icons from all applications
./examples/batch_extract.sh#!/bin/bash
# Extract icon and use it in your workflow
if icongrabber /Applications/MyApp.app -o assets/icon.png -s 512; then
echo "✓ Icon extracted successfully"
# Do something with the icon
convert assets/icon.png -resize 64x64 assets/icon-small.png
fiIcons are automatically named based on the app name (spaces removed):
| Application | Output File |
|---|---|
| Safari.app | Safari.png |
| Visual Studio Code.app | VisualStudioCode.png |
| Calculator.app | Calculator.png |
Use -o to specify your own filename:
icongrabber /Applications/Safari.app -o my-custom-name.png# Clone the repository
git clone https://github.com/macadmins/icongrabber.git
cd icongrabber
# Build
make build
# Run locally
./bin/icongrabber /Applications/Safari.app# Run the full test suite
make test
# Tests include:
# - Basic icon extraction
# - Multiple sizes (16, 32, 64, 128, 256, 512, 1024)
# - Custom output paths
# - Error handling
# - CLI argument parsingSee tests/README.md for detailed test documentation.
make cleanThe project uses GitHub Actions for automated testing:
- Integration tests on every PR
- Multi-version testing (macOS 15, latest)
- Installation verification
- Swift syntax checking
View the CI workflow for details.
- Contributing Guide - How to contribute
- Release Guide - For maintainers: creating releases
- Test Documentation - Test suite details
- Scripts Documentation - Helper scripts
- Man Page -
man icongrabber(after installation)
Q: What formats are supported? A: Currently PNG format only. Icons are extracted at the highest quality available.
Q: How does the file size optimization work?
A: The --max-file-size option uses macOS's built-in sips tool to compress the icon by converting to JPEG with varying quality levels, then back to PNG. This reduces file size while maintaining reasonable visual quality. You can specify sizes like 100KB, 100K, 2MB, or 2M (case-insensitive). If you don't specify an icon size with -s, the tool will automatically select an appropriate size based on your file size target.
Q: What if an app doesn't have an icon? A: The tool will exit with an error code and display an error message.
Q: Can I use this in my build scripts? A: Absolutely! The tool returns proper exit codes (0 for success, non-zero for errors) for easy integration.
Q: Does this work with paths containing spaces?
A: Yes! Just wrap the path in quotes: icongrabber "/Applications/Visual Studio Code.app"
Q: Can I use ~ in paths?
A: Yes, tilde expansion is supported: icongrabber ~/Applications/MyApp.app
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Improve documentation
Please see CONTRIBUTING.md for guidelines.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Built with Swift and AppKit for the macOS community.
Made with ❤️ for macOS administrators, developers and designers