基于 Tinify API 的 macOS 图片压缩工具,一键在 Finder 工具栏压缩图片。
TinyImage.app 拖到 /Applications(应用程序)文件夹xattr -d com.apple.quarantine /Applications/TinyImage.app
⌘ Command 键,用鼠标将 TinyImage.app 拖到 Finder 工具栏
前往 Tinify 官网 注册,免费获得 API Key 。
复制下方命令,将 your_api_key_here 替换为你的真实 API Key,粘贴到终端执行:
如果你使用的是 zsh(默认):
echo 'export TINIFY_IMAGE_API_KEY="your_api_key_here"' >> ~/.zshrc && echo 'export TINIFY_SUCCESS_NOTIFICATION_TYPE="dialog"' >> ~/.zshrc && source ~/.zshrc
如果你使用的是 bash:
echo 'export TINIFY_IMAGE_API_KEY="your_api_key_here"' >> ~/.bash_profile && echo 'export TINIFY_SUCCESS_NOTIFICATION_TYPE="dialog"' >> ~/.bash_profile && source ~/.bash_profile
执行命令检查:
echo $TINIFY_IMAGE_API_KEY
如果显示你的 API Key ,说明配置成功 ✅
压缩后的图片保存在 tinified 文件夹中。
修改 TINIFY_SUCCESS_NOTIFICATION_TYPE 环境变量的值:
| 值 | 效果 |
|---|---|
dialog |
弹窗提示(推荐) |
notification |
系统通知 |
none |
静默(无提示) |
修改方法(同样替换 API Key ):
# zsh 用户
echo 'export TINIFY_SUCCESS_NOTIFICATION_TYPE="notification"' >> ~/.zshrc && source ~/.zshrc
# bash 用户
echo 'export TINIFY_SUCCESS_NOTIFICATION_TYPE="notification"' >> ~/.bash_profile && source ~/.bash_profile