A tiny CLI tool to quickly change the output format of macOS screenshots. Useful for reducing file size depending on the type of screenshot โ e.g., PNG for graphics, JPG for photos, etc.
- macOS
- zsh (default on macOS)
- Ability to run
defaults writeand restartSystemUIServer๐ค
-
Clone the repo:
git clone https://github.com/sleipner01/zsh-screenshot-format.git ~/scfmt -
Add it to your PATH (e.g., in
~/.zshrc):export PATH="$HOME/scfmt:$PATH"
-
Add the completion directory to your
fpathand enable completions (in~/.zshrc):fpath=(~/scfmt $fpath) autoload -Uz compinit && compinit
-
Make the script executable:
chmod +x ~/scfmt/scfmt
Reload the shell:
source ~/.zshrcRun the command followed by the desired format:
scfmt png
scfmt jpgShow current format and help:
scfmt --helpSupported formats: png, jpg, jpeg, gif, tiff, heic.
- PNG: Best for UI screenshots, text, graphics (lossless)
- JPG/JPEG: Best for photos (lossy, smaller files)
- HEIC: Modern format with good compression (macOS 10.13+)
- GIF: Limited use (256 colors, supports animation)
- TIFF: Large files, high quality (rarely needed for screenshots)
I take many screenshots of print products, where the optimal format varies. Switching formats lets me significantly reduce file size on both:
- internal servers, and
- the websites where these images are used.
This tool makes that switch instant and painless ๐
Contributions are welcome! Feel free to:
- Report bugs or suggest features via Issues
- Submit pull requests for improvements
- Share feedback or use cases
MIT License - see LICENSE file for details.