Expand description
§Sharpy
High-performance image sharpening library for Rust.
This library provides multiple sharpening algorithms optimized for performance with parallel processing support. It includes both a library API and a CLI tool.
§Quick Start
use sharpy::Image;
// Load and sharpen an image
let image = Image::load("photo.jpg")?;
let sharpened = image.unsharp_mask(1.0, 1.0, 0)?;
sharpened.save("photo_sharp.jpg")?;§Available Algorithms
- Unsharp Mask - Classic sharpening by subtracting a blurred version
- High-Pass - Convolution-based sharpening using a high-pass kernel
- Edge Enhancement - Detects and enhances edges using Sobel or Prewitt
- Clarity - Local contrast enhancement for improved detail
§Using the Builder Pattern
use sharpy::{Image, EdgeMethod};
let result = Image::load("landscape.jpg")?
.sharpen()
.unsharp_mask(1.0, 1.2, 1)
.edge_enhance(0.5, EdgeMethod::Sobel)
.clarity(0.4, 3.0)
.apply()?;§Performance
All algorithms use parallel processing via Rayon for optimal performance. The library uses copy-on-write semantics to minimize memory allocations.
Structs§
- Image
- The main image type that provides sharpening operations.
- Sharpening
Builder - Builder for configuring and applying sharpening operations.
- Sharpening
Presets - Preset sharpening configurations for common use cases.
Enums§
- Edge
Method - Image
Error - Operation
- Represents a sharpening operation that can be applied to an image.