Skip to content

sleipner01/zsh-screenshot-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ผ๏ธ 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.

About

zsh cli-tool to change MacOS screenshot format ๐Ÿ“ธ

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages