A high-performance Rust image processing library.
The library provides low-level access to pixel and channel manipulation, as well as high-level functions for convolution, thresholding, and edge-detection.
Functions include:
- thresholding
- convolutions
- sharpening
- edge-detection
- Sobel filters
- Laplace effects
- altering channels
- altering R, G, B channel values.
- greyscaling
- increasing saturation
- brightness adjustment
photon
can be thought of as a high-level wrapper to the Rust image crate, but conversely also includes functions which provide low-level access to pixel and channel manipulation, perfect for developers who wish to work with this data directly.
View the official website.
Documentation can be found here.
The GIF below shows an image cycling through various effects available. Don't take heed of the quality, since this is a GIF and merely for demonstration purposes. You should run the library's binary for a more thorough analysis.
Clone this repo, then run:
cargo run --release
which will run the binary file. Ensure you have an image with the same name as that in the bin file.
extern crate photon;
fn main() {
let img = photon::helpers::open_image("daisies.JPG");
let filtered_img = photon::conv::sobel_vertical(img);
// Write the contents of this image in PNG format.
photon::helpers::save_image(filtered_img, "new_image.PNG");
}
Photon contains a series of modules, which include:
effects
: Various image effects, including adding offsets, thresholding, duotoning, solarization, etc.,channels
: Functions related to increasing/decreasing the red, green, and blue channels of the image data.filters
: Preset filters, which alter the rgb channels of the image. Contains over 20.conv
: Laplace, Sobel, emboss; image proc functions which require image convolution.noise
: Noise generation of varying tints and hues.
All effects and filters can be viewed below and on the official website.
View the official documentation here.
- Error detection and exception handling.
Functions have been designed with flexibility in mind, so that full customization of effects and filters can be utilised; for every function, hundreds of differing image effects/tints/hues can be created, just by changing parameters slightly, so with every function comes the ability to fully experiment.
For developers who would like to work with high-level constructs can do so, such as applying effects to imagery (eg: Laplace or Sobel) or filters; this library provides a complete suite of functions to do so, as well as in-built filters and presets.
Photon is always ready for new filters and functions, so if you'd like to contribute, just submit a Pull Request. :)