Skip to content

Latest commit

Β 

History

History
96 lines (63 loc) Β· 2.33 KB

File metadata and controls

96 lines (63 loc) Β· 2.33 KB

πŸ–ΌοΈ scfmt β€” Simple macOS Screenshot Format Switcher

License: MIT macOS Shell: zsh

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.


πŸ“¦ Prerequisites

  • macOS
  • zsh (default on macOS)
  • Ability to run defaults write and restart SystemUIServer πŸ€“

πŸ“₯ Installation

  1. Clone the repo:

    git clone https://github.com/sleipner01/zsh-screenshot-format.git ~/scfmt
  2. Add it to your PATH (e.g., in ~/.zshrc):

    export PATH="$HOME/scfmt:$PATH"
  3. Add the completion directory to your fpath and enable completions (in ~/.zshrc):

    fpath=(~/scfmt $fpath)
    autoload -Uz compinit && compinit
  4. Make the script executable:

    chmod +x ~/scfmt/scfmt

Reload the shell:

source ~/.zshrc

πŸ› οΈ Usage

Run the command followed by the desired format:

scfmt png
scfmt jpg

Show current format and help:

scfmt --help

Supported formats: png, jpg, jpeg, gif, tiff, heic.

Format Recommendations

  • 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)

πŸ’‘ Why this tool?

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 πŸš€

🀝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs or suggest features via Issues
  • Submit pull requests for improvements
  • Share feedback or use cases

πŸ“„ License

MIT License - see LICENSE file for details.