Skip to content

Releases: benface/bgone

v0.5.0

07 Dec 21:52
b362931

Choose a tag to compare

What's New

Added

  • --trim CLI flag to crop output images to the bounding box of non-transparent pixels
  • trim_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() to cargo::cargo_bin!() macro in tests
  • Fixed clippy items_after_test_module warning by reorganizing lib.rs

Installation

Homebrew (macOS)

brew tap benface/bgone
brew install bgone

Cargo

cargo install bgone

Checksums (SHA256)

  • bgone-v0.5.0-aarch64-apple-darwin.tar.gz: 985c34d524bf2b2b0914cb7713b90aa97f0cf0ba6997435524f4903b018b0ff4
  • bgone-v0.5.0-x86_64-apple-darwin.tar.gz: 0035ba3d74daba367a49005875771cc37884dfde918d2584f98065b0999c7e26

v0.4.0

06 Oct 17:04
00cae10

Choose a tag to compare

🎨 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 inputPNG 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.0

This release makes bgone more intelligent, modern, and user-friendly while maintaining backward compatibility!

v0.3.0

06 Oct 13:59
a82405c

Choose a tag to compare

🎉 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.png and get input-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

21 Sep 22:41
76d496b

Choose a tag to compare

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 --release flag 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

21 Sep 14:33
24964a9

Choose a tag to compare