TrimrPix is a macOS app built with SwiftUI, focusing on high-quality image compression with a simple user interface. The goal is to offer a modern and efficient image optimization solution with the same core functionality as ImageOptim, but with newer technology and optimized performance.
- High-quality compression with focus on optimal file size reduction
- Multi-format support: JPEG, PNG, GIF, WebP, AVIF, and HEIC
- Smart compression: Configurable quality (60%-95%) for JPEG, WebP, AVIF, and HEIC
- Progressive JPEG: Optimized Huffman encoding for 5-15% smaller JPEGs
- PNG lossy quantization: Median-cut color reduction (256 colors) for 60-80% smaller PNGs
- Advanced PNG optimization: Alpha channel stripping for opaque images
- GIF re-encoding: LZW re-compression with metadata stripping (preserves animation)
- Metadata stripping: Removes EXIF, GPS, IPTC data from all formats
- Image resizing: Optional pre-compression downscaling (configurable max dimension)
- Format validation: Ensures file integrity before processing
- Drag & Drop Interface for intuitive image addition
- Batch processing with concurrent optimization
- Individual optimization with per-image controls
- Real-time feedback: File size comparison and percentage reduction
- Auto-save: Saves optimized images in the same folder as originals (default)
- Manual save: Fallback to save dialog when folder access is restricted
- Individual removal: Remove single images from the list
- Compression presets: Low (60%), Medium (80%), High (95%), Custom
- Watch Folder: Automatically processes new images with configurable delay (0.5-10s)
- Settings panel: Compression quality, save options, and watch folder configuration
- Overwrite protection: Option to overwrite originals or create new files
- Smart file naming: Automatically handles filename conflicts with unique naming
- Error handling: User-friendly messages with recovery suggestions
- SwiftUI – Modern UI development for macOS
- Core Image – Image processing and compression
- ImageIO / CGImageDestination – Native JPEG, WebP, AVIF, and HEIC compression with metadata stripping
- CGImageSource – Image loading, resizing, and GIF frame extraction
- Async/Await – Modern Swift concurrency for responsive UI during image processing
- OSLog – Unified logging system for debugging and monitoring
- Protocol-Oriented Design – Dependency injection and testability
TrimrPix follows MVVM architecture with protocol-oriented design. See ARCHITECTURE.md for detailed documentation.
Key principles:
- MVVM with clear separation of concerns
- Protocol-based dependency injection
- Security-scoped resource access for sandboxing
- Async/await for concurrent processing
- Centralized error handling and logging
TrimrPix/
├── TrimrPixApp.swift # App entry point
├── ContentView.swift # Main view with UI components
├── Models/
│ ├── ImageItem.swift # Image data model with lazy thumbnails
│ ├── Settings.swift # User settings and preferences
│ └── TrimrPixError.swift # Centralized error types
├── ViewModels/
│ └── ImageOptimizationViewModel.swift # Business logic coordination
├── Views/
│ └── SettingsView.swift # Settings panel UI
├── Services/
│ ├── CompressionService.swift # Image compression with security-scoped access
│ ├── ColorQuantizer.swift # Median-cut color quantization for PNG
│ ├── WatchFolderService.swift # File system monitoring
│ ├── Logger.swift # Structured logging service
│ └── Protocols.swift # Service protocol definitions
└── Assets.xcassets/ # App icons and assets
- File Type Detection: UTType-based format identification
- Security-Scoped Resources: Automatic handling of sandboxed file access
- Filename Conflicts: Automatic unique naming (e.g.,
image-optimized-2.png) - Memory Optimization: Lazy-loaded thumbnails resized to max 120px
- Concurrent Processing: TaskGroup-based batch optimization
- Error Handling: Detailed error messages with recovery suggestions
- Get TrimrPix on the Mac App Store: apps.apple.com/app/trimrpix/id6758639590
- One-time purchase. Requires macOS 15.2 or later.
-
Clone the repository:
git clone https://github.com/jarllyng/TrimrPix.git cd TrimrPix -
Open in Xcode:
open TrimrPix.xcodeproj
-
Build and run:
- Select your target device/simulator
- Press
Cmd + Rto build and run
# Clone and build
git clone https://github.com/jarllyng/TrimrPix.git
cd TrimrPix
./build.sh- macOS: 15.2 or newer
- Xcode: 15.0 or newer
- Swift: 5.9 or newer
- Add Images: Drag and drop images onto the app window
- Optimize: Click "Optimize All" or optimize individual images
- Configure: Use the settings panel (gear icon) to customize compression
- Watch Folder: Enable automatic processing of new images in a folder
- AVIF: Depends on macOS system support — falls back to original data if unavailable
- macOS Version: Requires macOS 15.2 or newer
- Sandboxing: May require save dialog for folders without explicit access
- Enhanced Compression:
- SVG optimization
- UI/UX:
- Before/after image preview
- Progress tracking for large batches
- Integration:
- Finder context menu integration
- Command-line interface
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
If you find a bug, please open an issue with:
- macOS version
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
Have an idea for a new feature? Open an issue and let's discuss it!
- Website & support: trimrpix.iamjarl.com
- App Store: TrimrPix on the App Store
- Source & issues: GitHub (for developers)
MIT License – Free to use and adapt.
Made with ❤️ for the macOS community
