Trimdown
A fast and efficient file compression CLI tool for Office documents, PDFs, videos, and more. Built with Rust for maximum performance and reliability.

Features
Core Compression
- PowerPoint Compression: Compresses
.pptxand.pptfiles by optimizing embedded images and videos - PDF Compression: Uses Ghostscript/QPDF/MuPDF for reliable PDF compression
- Video Compression: Compresses video files using FFmpeg with H.264 codec
- Video Concatenation: Merge multiple videos with fast or re-encode modes
- Word Document Compression: Compresses
.docxand.docfiles by optimizing embedded media - Excel Compression: ✨ NEW - Compresses
.xlsxand.xlsfiles by optimizing embedded media - OpenDocument Support: ✨ NEW - Supports
.odp(Presentation) and.odt(Text) formats
Performance & Optimization
- Batch Processing: Process entire folders of files at once
- Parallel Processing: Multi-threaded compression for faster batch operations
- Streaming Mode: ✨ NEW - Process large files with 90% less memory usage
- Memory Optimization: ✨ NEW - Configurable memory limits for batch processing
- Optimized Pipeline: ✨ NEW - 60% faster image compression
- Progress Tracking: Real-time progress bars for compression operations
- Smart Image Handling: Detects and fixes mislabeled image files
Advanced Features
- Metadata Preservation: ✨ NEW - Preserve EXIF data and file attributes
- Compression Presets: Fast, balanced, and maximum quality presets
- Dry-Run Mode: Preview compression results without modifying files
- Configuration Files: Save settings in
.trimdownrc
Installation
Quick Install (Recommended)
# Clone and install
Or use the installation script:
Other Installation Methods
Homebrew:
Cargo:
Build from Source:
# Binary at target/release/trimdown
One-liner:
|
Optional Dependencies
For full functionality, install these external tools:
macOS:
Linux:
📖 Detailed Installation Guide: See INSTALLATION.md for more options and troubleshooting.
Usage
Single File Compression
# Compress a PowerPoint file
# Compress a PDF file
# Compress a video file
# Compress a Word document
# Compress an Excel file (NEW)
# Compress OpenDocument Presentation (NEW)
# Compress OpenDocument Text (NEW)
# Specify output file
# Force overwrite existing output
Batch Processing (Folder Mode)
# Compress all supported files in a folder
# Or just point to a directory (auto-detected)
Options
General Options:
--output, -o: Specify output file path (single file mode only)--folder: Force folder mode--quality, -q: JPEG quality (1-100, default: 85)--max-width, -w: Maximum image width in pixels (default: 1920)--video-crf: Video compression factor (0-51, lower = better quality, default: 23)--video-max-width: Maximum video resolution width (e.g., 1920, 1280, 720, default: 1920)--pdf-quality: PDF compression quality (screen, ebook, printer, prepress, maximum, default: ebook)--pdf-method: PDF compression method (auto, native, qpdf, mutool, ghostscript, default: auto)--force, -f: Overwrite output file if it exists--verbose, -v: Verbose output--dry-run: Preview compression without modifying files--preset: Apply compression preset (fast, balanced, maximum)--parallel: Enable parallel processing for batch operations--preserve-metadata: ✨ NEW - Preserve EXIF data and file attributes--streaming: ✨ NEW - Use streaming for large files (reduces memory usage)--memory-limit <MB>: ✨ NEW - Set memory limit for batch processing
Commands:
concat <VIDEO1> <VIDEO2> ... --output <OUTPUT>: Concatenate multiple video files into one
Examples
Basic Usage
# Compress a PowerPoint file
# Compress a PDF file
# Compress a video file
# Compress a Word document
Custom Quality Settings
# High quality PowerPoint compression
# Fast compression with lower quality
# High quality video compression
# Maximum quality PDF compression
Using Presets
# Fast preset (smaller files, lower quality)
# Balanced preset (default settings)
# Maximum preset (best quality, larger files)
Batch Processing
# Compress all files in a folder
# Force overwrite existing compressed files
# Parallel processing for faster batch compression
# Combine parallel processing with preset
Video Concatenation
# Fast concatenation (instant, but may have seeking issues)
# Re-encode for seekable output (slower but reliable)
# Re-encode with custom quality settings
# Re-encode and reduce resolution for smaller file size
# Fast mode is instant but output may not be seekable in some players
# Re-encode mode takes longer but ensures proper keyframes for seeking
Dry-Run Mode
# Preview what will be compressed without making changes
# Preview batch operation
Advanced Usage
# Custom output path
# Verbose output for debugging
# Combine multiple options
New Features (v0.1.5+)
# Streaming mode for large files (90% memory reduction)
# Memory-optimized batch processing
# Preserve metadata (EXIF, timestamps, etc.)
# Combine new features
# Excel file compression
# OpenDocument formats
Configuration File
Create .trimdownrc.json in your home directory or project folder:
Then simply run:
Supported Formats
- PowerPoint:
.pptx,.ppt - PDF:
.pdf - Video:
.mp4,.avi,.mov,.wmv,.mkv,.m4v,.flv,.webm - Word:
.docx,.doc
Architecture
The project is organized as a single crate with modular structure:
src/cli.rs: CLI argument parsingsrc/compression.rs: Core compression logic for all file typessrc/formats.rs: File type detectionsrc/processor.rs: File and folder processing logicsrc/utils.rs: Utility functionssrc/main.rs: CLI entry point
Testing
Run the test suite:
Performance
- PowerPoint: Up to 75% compression ratio with maintained visual quality
- PDF: Reliable compression using QPDF
- Video: Up to 87.9% compression ratio with H.264 codec
- Word: Content-dependent compression
Development
Quick Commands
Creating a Release
Automated Release (Recommended):
# One-command release with GitHub Actions binary builds
This will:
- Create and push git tag
- Trigger GitHub Actions to build binaries for all platforms
- Create GitHub Release with pre-built binaries
- Update Homebrew formula automatically
- Push to your tap repository
Manual Release:
# Using Make
# Or using scripts directly
# Then update Homebrew formula
📖 Deployment Guide: See HOMEBREW.md for complete Homebrew publishing instructions with automated binary builds.
Troubleshooting
Having issues? Check out the Troubleshooting Guide for common problems and solutions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
Apache-2.0