Parallel Image Processor is a small Rust desktop app about making image work feel concrete. It keeps the interface simple, then spends the interesting energy on how pixels move through a multithreaded pipeline.
It opens common image files, applies filters, and splits the image rows across worker threads. The command line tool still reads and writes binary PPM images for small experiments, while the desktop app is the comfortable way to try it with normal photos.
Rust 1.92 or newer is required.
Desktop app:
cargo run --release --bin desktop
PPM command line:
cargo run --release -- input.ppm output.ppm --filter grayscale --filter blur:2 --threads 4
- Apply invert, grayscale, brightness, threshold, and blur filters.
- Open PNG, JPEG, and BMP images in the desktop app.
- Save the processed result as a PNG file.
- Chain filters so the output of one stage becomes the input of the next.
- Divide rows fairly across workers, even when the image height does not split evenly.
- Process blur safely by reading from one image while writing into a separate output image.
- Report how many workers were used for each filter stage.
The image buffer is flat: one Vec<Pixel> stores pixels row by row. That makes it easy to hand each worker a different mutable slice of the output. Threads do not fight over the same pixels, and the source image is shared read-only.
Blur is the most useful teaching filter in the project. A pixel needs to look at its neighbors, so the code cannot simply edit the image in place. That separation between input and output is the quiet trick that keeps the threaded version deterministic.
PPM is still used in the command line path because it is small enough to understand at a glance. The desktop app adds normal photo formats around the same processing core, so the useful part of the project stays in one place.
src/pixel.rskeeps small RGB color operations.src/image.rsowns dimensions and the pixel buffer.src/codec.rsloads and saves common image files.src/plan.rsdecides which rows each worker receives.src/filters.rsdefines the filters and their text names.src/processor.rsruns filters with scoped threads.src/ppm.rsreads and writes the image format.src/bin/desktop.rscontains the desktop app.tests/pipeline.rschecks the full library flow.
cargo fmt --all -- --check
cargo test --locked --lib --bins --tests
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo build --locked --release --bins
GitHub Actions runs strict quality checks and release builds across Windows, Linux, and macOS. It also checks declared Rust 1.92 minimum version.
Processing library includes serial reference implementation. Tests require serial and parallel paths to produce identical results. Criterion suite compares both paths using point and neighborhood filters:
cargo bench --bench processing
Current i7-8700 baseline reaches 3.11x speedup for 1080p grayscale and 3.90x for radius-2 blur with eight workers. Benchmark design, full results, and environment live in docs/benchmarking.md. Concurrency invariants and current tradeoffs live in docs/architecture.md.
CHANGELOG.mdrecords release-facing changes.CONTRIBUTING.mddefines required quality gates.SECURITY.mddefines private vulnerability reporting.
