从源码构建需 Rust >= 1.79.0;GIF 仅支持有损压缩,不支持无损;输出到同一目录时建议用 --suffix 避免覆盖原图
caesium-clt
Lymphatus活跃维护用 Rust 写的命令行图片压缩工具,支持 JPEG、PNG、WebP 的有损和无损压缩,适合批量减小图片体积。
Caesium Command Line Tools - Lossy/lossless image compression tool
cargo install caesiumclt
brew install caesiumcltREADME 未说明,仅列出支持 Windows/macOS/Linux 的 x86_64 与 aarch64 平台
Rust 写的命令行图片压缩工具,支持有损/无损与目标体积压缩,适合批量处理
用 Rust 写的命令行图片压缩工具,支持 JPEG、PNG、WebP 的有损和无损压缩,适合批量减小图片体积。
核心能力
- 按质量、无损或目标文件大小三种模式压缩
- 支持 JPEG/PNG/WebP/GIF,可互转格式
- 按宽高或长短边缩放并保留 EXIF 与时间戳
- 递归压缩目录并保留原文件夹结构
- 多线程并行处理,可指定线程数并支持 dry-run
容易踩的坑
- v1.5.0最新正式版2026-09-16 · 2026-09-16 12:04 UTC
Downloads
Platform Architecture Filename macOS ARM64 caesiumclt-v1.5.0-aarch64-apple-darwin.tar.gz macOS x86_64 caesiumclt-v1.5.0-x86_64-apple-darwin.tar.gz Linux ARM64 caesiumclt-v1.5.0-aarch64-unknown-linux-musl.tar.gz Linux x86_64 caesiumclt-v1.5.0-x86_64-unknown-linux-musl.tar.gz Windows x86_64 caesiumclt-v1.5.0-x86_64-pc-windows-msvc.zip - v1.4.02026-07-08 · 2026-07-08 06:29 UTC
查看更新说明
Downloads
Platform Architecture Filename macOS ARM64 caesiumclt-v1.4.0-aarch64-apple-darwin.tar.gz macOS x86_64 caesiumclt-v1.4.0-x86_64-apple-darwin.tar.gz Linux ARM64 caesiumclt-v1.4.0-aarch64-unknown-linux-musl.tar.gz Linux x86_64 caesiumclt-v1.4.0-x86_64-unknown-linux-musl.tar.gz Windows x86_64 caesiumclt-v1.4.0-x86_64-pc-windows-msvc.zip - v1.3.02026-03-31 · 2026-03-31 20:16 UTC
查看更新说明
Downloads
Platform Architecture Filename macOS ARM64 caesiumclt-v1.3.0-aarch64-apple-darwin.tar.gz macOS x86_64 caesiumclt-v1.3.0-x86_64-apple-darwin.tar.gz Linux ARM64 caesiumclt-v1.3.0-aarch64-unknown-linux-musl.tar.gz Linux x86_64 caesiumclt-v1.3.0-x86_64-unknown-linux-musl.tar.gz Windows x86_64 caesiumclt-v1.3.0-x86_64-pc-windows-msvc.zip - v1.2.02025-12-08 · 2025-12-08 13:10 UTC
查看更新说明
Generated by Github Actions
- v1.1.12025-11-24 · 2025-11-24 19:05 UTC
查看更新说明
Generated by Github Actions
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Caesium Command Line Tools 
caesiumclt is a powerful command-line tool for image compression written in Rust that delivers exceptional results with minimal effort. Whether you need pixel-perfect lossless compression or aggressive size reduction, caesiumclt has you covered.
Built on the robust libcaesium engine, it combines high performance with flexibility to fit seamlessly into your workflow.
✨ Features
-
Multiple Compression Modes
- 🔍 Quality-based lossy compression
- 💎 Lossless compression—preserve image quality while reducing size
- 📏 Maximum size compression - target specific file sizes
-
Advanced Image Processing
- 📐 Resize images with multiple options (width, height, long/short edge)
- 🔄 Convert between formats (JPEG, PNG, WebP)
- 🏷️ EXIF metadata preservation
-
Workflow Optimization
- *️⃣ Recursive directory compression
- 📁 Folder structure preservation
- 🕒 File timestamp preservation
- 📝 Custom suffix for output files
- ⚡ Fast and customizable multithreaded processing
Supported Formats
| Format | Lossy | Lossless |
|---|---|---|
| JPEG | ✅ | ✅ |
| PNG | ✅ | ✅ |
| WebP | ✅ | ✅ |
| GIF | ✅ | ❌ |
🚀 Getting Started
Binaries
Download the latest binaries from the release page.
Supported platforms:
- Windows (x86_64)
- macOS (x86_64/aarch64)
- Linux (x86_64/aarch64)
Installation
Cargo
cargo install caesiumclt
Homebrew
brew install caesiumclt
Winget
winget install SaeraSoft.CaesiumCLT
🛠️ Development
Requirements
- Rust >= 1.79.0
Quick Start
-
Clone the repository:
git clone https://github.com/Lymphatus/caesium-clt.git cd caesium-clt -
Build the project:
cargo build -
Build for release (optimized):
cargo build --release -
Run the tool directly:
cargo run -- [your-arguments-here] -
Run tests:
cargo test
📖 Usage
For a complete list of all flags and options, refer to the full documentation.
Examples
Lossless compression:
# Compress a single image
$ caesiumclt --lossless -o output/ image.jpg
# Compress with metadata preservation
$ caesiumclt --lossless -e --keep-dates -o output/ image.jpg
# Compress a directory recursively
$ caesiumclt --lossless -R -o output/ Pictures
# Preserve folder structure
$ caesiumclt --lossless -RS -o output/ Pictures
Lossy compression:
# Compress with quality setting
$ caesiumclt -q 80 -o output/ image.jpg
# Compress multiple images with a specific quality
$ caesiumclt -q 75 -o output/ image1.jpg image2.png image3.webp
# Compress with suffix to avoid overwriting originals
$ caesiumclt -q 85 --suffix _compressed --same-folder-as-input image.jpg
Format conversion:
# Convert images to WebP format with quality setting
$ caesiumclt -q 85 --format webp -o output/ Pictures/*.jpg
# Convert PNG to JPEG with maximum quality
$ caesiumclt -q 100 --format jpeg -o output/ image.png
Resizing options:
# Resize to specific width (maintaining aspect ratio)
$ caesiumclt --lossless --width 1920 -o output/ image.jpg
# Resize to specific height (maintaining aspect ratio)
$ caesiumclt -q 90 --height 1080 -o output/ image.jpg
# Resize by longest edge (useful for mixed portrait/landscape photos)
$ caesiumclt -q 85 --long-edge 1500 -o output/ Pictures/*.jpg
# Resize by shortest edge
$ caesiumclt -q 85 --short-edge 800 -o output/ Pictures/*.jpg
Advanced options:
# Target a specific maximum file size (500KB)
$ caesiumclt --max-size 512000 -o output/ large-image.jpg
# Parallel processing with specific thread count
$ caesiumclt -q 80 --threads 4 -R -o output/ Pictures/
# Dry run to test compression without writing files
$ caesiumclt -q 80 --dry-run -o output/ Pictures/
# PNG optimization with highest compression level
$ caesiumclt --lossless --png-opt-level 6 -o output/ image.png
# JPEG advanced options with specific chroma subsampling
$ caesiumclt -q 85 --jpeg-chroma-subsampling "4:2:0" --jpeg-baseline -o output/ image.jpg
Overwrite policies:
# Never overwrite existing files
$ caesiumclt -q 85 -O never -o output/ Pictures/*.jpg
# Overwrite only if the existing file is bigger
$ caesiumclt -q 85 -O bigger -o output/ Pictures/*.jpg