Compress PDFs/PNGs/SVGs and batch-convert images — all from a TUI.
- PDF — Stream recompression (zlib level 9), unused object cleanup, metadata stripping, stream deduplication
- PNG — Lossless optimization via oxipng
- SVG — Whitespace removal, attribute shortening, decimal precision reduction
- Interactive TUI — File browser, quality selector, real-time progress
- Batch image conversion — Recursively scan a folder and convert all images
- Input formats — JPG, PNG, HEIC, WebP
- Output formats — JPG, PNG, WebP
- Size presets — Large (1920px), Medium (1280px), Small (640px)
- HEIC support — macOS
sipsfor HEIC decoding - Parallel processing — Uses all CPU cores
- Structure preserved — Subdirectory layout maintained in
{folder}_converted/
git clone https://github.com/Dann1y/pdf_squish.git
cd pdf_squish
cargo build --releaseThe binary will be at target/release/pdf-squish.
# Launch TUI
cargo run --release
# Pre-fill input path
cargo run --release -- /path/to/file.pdf| Key | Action |
|---|---|
Ctrl+T |
Toggle Compress / Convert mode |
Tab / Shift+Tab |
Cycle focus |
Enter |
Load files / Start |
1 2 3 |
Compress: Quality — Convert: Output format |
4 5 6 |
Convert: Size preset |
j k / ↑ ↓ |
Navigate file list |
d |
Remove selected file |
r |
Reset after completion |
q |
Quit |
| Strategy | Light | Standard | Aggressive |
|---|---|---|---|
| Stream recompression (zlib best) | ✓ | ✓ | ✓ |
| Empty stream removal | ✓ | ✓ | ✓ |
| Unused object cleanup | ✓ | ✓ | |
| Metadata stripping | ✓ | ✓ | |
| Object renumbering | ✓ | ✓ | |
| Duplicate stream dedup | ✓ |
- ratatui + crossterm — TUI
- lopdf — PDF manipulation
- flate2 — Compression
- oxipng — PNG optimization
- image — Image decoding/encoding/resizing
- walkdir — Recursive directory traversal
- tokio — Async runtime
- sha2 — Deduplication hashing
MIT