Releases: benface/bgone
v0.5.0
What's New
Added
--trimCLI flag to crop output images to the bounding box of non-transparent pixelstrim_to_content()public function in library API- 8 new tests for trim functionality covering various edge cases
Changed
- Updated all dependencies via
cargo update - Migrated from deprecated
assert_cmd::Command::cargo_bin()tocargo::cargo_bin!()macro in tests - Fixed clippy
items_after_test_modulewarning by reorganizing lib.rs
Installation
Homebrew (macOS)
brew tap benface/bgone
brew install bgoneCargo
cargo install bgoneChecksums (SHA256)
bgone-v0.5.0-aarch64-apple-darwin.tar.gz:985c34d524bf2b2b0914cb7713b90aa97f0cf0ba6997435524f4903b018b0ff4bgone-v0.5.0-x86_64-apple-darwin.tar.gz:0035ba3d74daba367a49005875771cc37884dfde918d2584f98065b0999c7e26
v0.4.0
🎨 Smart Format & Alpha Handling + Rust 2024
This release brings intelligent format handling, proper alpha channel support, and upgrades to the latest Rust edition!
✨ New Features
Intelligent Alpha Channel Handling
bgone now correctly processes images with existing transparency:
- Translucent pixels are pre-composited over the background color
- Background auto-detection composites translucent edges over black
- Works perfectly with PNG files, anti-aliased edges, and semi-transparent graphics
Example: A semi-transparent red pixel rgba(255, 0, 0, 128) on white background → rgb(255, 127, 127) before processing
Smart Format Selection
Automatic output format conversion for formats without alpha support:
- JPEG/BMP input → PNG output (preserves transparency)
- Formats with alpha (PNG, WebP, TIFF, GIF, etc.) → preserved
- Case-insensitive extension handling
bgone photo.jpg # → photo-bgone.png (auto-converted!)
bgone logo.png # → logo-bgone.png (preserved)
bgone image.webp # → image-bgone.webp (preserved)🔧 Improvements
Rust Edition 2024 Upgrade
- Upgraded from Edition 2021 → 2024
- New syntax: let-chains in if statements
- Modern patterns:
RangeInclusive::contains() - Cleaner code: removed unnecessary let-bindings and closures
- Zero clippy warnings
Documentation Cleanup
- Simplified "Supported Formats" section
- Clearer, more concise README
- Better examples with inline comments
🧪 Testing
- 82 tests (added 7 new tests)
- Full coverage for alpha compositing
- Format conversion test coverage
- All tests passing
📦 Installation
# Homebrew
brew upgrade bgone
# Cargo
cargo install bgone --version 0.4.0This release makes bgone more intelligent, modern, and user-friendly while maintaining backward compatibility!
v0.3.0
🎉 Optional Output Argument
This release makes the output argument optional, simplifying the most common usage pattern!
✨ New Features
- Auto-generated output filenames: Simply run
bgone input.pngand getinput-bgone.png - Smart incremental naming: Automatically appends
-bgone-1,-bgone-2, etc. when files exist - Preserves file extensions: Works with
.jpg,.png, or any format - Fully backwards compatible: Explicit output paths still work as before
📖 Usage Examples
# Before: had to specify output
bgone input.png output.png --fg auto
# Now: output is optional!
bgone input.png --fg auto
# Still works with explicit output
bgone input.png custom-name.png --fg auto🧪 Quality Improvements
- Added 7 comprehensive unit tests for output path generation
- All existing tests pass (77 tests total)
- Full test coverage for edge cases and incremental naming
🔧 Implementation Details
- Extension preservation and fallback to
.png - Automatic collision detection and resolution
- Supports up to 999 incremental files before erroring
This makes bgone even easier to use while maintaining all its powerful features!
v0.2.0
Major Improvements
- 🎯 Enhanced color deduction algorithm finds more optimal colors
- 🎨 Tie-breaker logic prefers colors furthest from background when reconstruction quality is equal
- 🧪 Expanded test coverage including mixed mode tests (e.g.,
--fg fff auto auto) - 🚀 Better handling of complex images with gradients and strokes
Algorithm Improvements
- Increased candidate thresholds for better color selection:
- 2 unknowns: 20 → 30 candidates
- 3 unknowns: 20 → 25 candidates (full search) or 20 (selected)
- Fixed handling of 3 unknowns with many candidates
- Extracted magic numbers into named constants for better maintainability
- Improved documentation explaining the tie-breaker logic
Test Improvements
- Added translucent recovery tests for strict mode with mixed colors
- Renamed "fully_auto" tests to "non_strict" for clarity
- Updated README to use
--releaseflag by default for better test performance - Fixed test assertion messages to use consistent format
The algorithm now correctly finds pure/saturated colors when they provide the best reconstruction, achieving > 95% similarity in complex test cases.
v0.1.0
Full Changelog: https://github.com/benface/bgone/commits/v0.1.0