A performance-minded library and application for applying image shaders. There are 2 major goals:
- This project aims to be as fast as possible and competitive with commercial implementations. I'm specifically targeting 24MP images on Apple silicon.
- It should be easy to add shaders. This should be doable without any real understanding of Rust. For more information see below.
This project is broken up into 3 crates: a core library and 2 applications which consume it.
bdip-core: The core library responsible for all image transformation logic and file I/O. It can be imported by any Rust application that wants to apply image transformations.bdip: A desktop GUI application for interactively editing images.bdip-cli: A CLI application that can be used for batch processing.
For development, you can clone the GitHub repo.
To install the release binaries, you can download the pre-compiled binaries (for Mac) or build them from source.
brew tap billdirks/bdip
brew trust billdirks/bdip
# Install the CLI application
brew install bdip-cli
# Install the desktop GUI application
brew install --cask bdipNavigate to the GitHub release page and download the binaries from the Assets section.
# Install the desktop GUI application
cargo install bdip
# Install the CLI application
cargo install bdip-cliUse these commands to build the release binaries directly from source:
# Build the bdip GUI app (not the mac app bundle)
cargo build --release -p bdip
# The release binary can be found in target/release/bdip
# Build the bdip-cli app
cargo build --release -p bdip-cli
# The release binary can be found in target/release/bdip-cliThe cargo aliases are helpful and can be found in .cargo/config.toml. I highlight some here.
cargo ui-releaseIf you decide on a set of transformations you like in the UI, you can export them (Export pipeline in the File pulldown) and pass that file to bdip-cli to apply it to images in a pipeline.
The command also takes an image path to be loaded:
cargo ui-release path/to/your/image.pngYou can replace ui-release with ui for a debug build. It will be noticeably slower.
Use cargo cli to run the headless app. You can chain --apply flags to apply
multiple transforms in order (left to right), or pass a pipeline file. Examples:
cargo cli input.tif --output out.png \
--apply 'abstract_geometry:0.37:18.5:0.2:0.51' \
--apply 'fisheye:-0.19'cargo cli input.tif --output out.png --pipeline pipeline.txtwhere pipeline.txt is:
abstract_geometry:0.37:18.5:0.20:0.51
fisheye:-0.19
cargo cli --help# List all available shaders
cargo cli --list-shaders
# Get detailed help for a specific shader
cargo cli --describe-shader <shader_id>1. Code Formatting Ensure all Rust code is neatly formatted:
cargo format2. Static Analysis Check for warnings, clippy issues, and unoptimized patterns across the entire workspace:
cargo lint3. Testing Run the core library unit tests and the end-to-end CLI flow tests:
cargo test --workspace4. Performance testing
cargo perf-test5. CLI performance diagnostics
cargo cli input.tif --output out.png --pipeline pipeline.txt --timingsAll shader implementations are found in this directory. Auxiliary image assets are stored here and can be shared between shaders. A how-to-write-a-shader doc, which can also be used by AI, can be found here.
The original specification and supporting architectural diagram along with a description of the execution model are found in the specs directory.