Code Monkey home page Code Monkey logo

photon's Introduction

photon

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.

Examples

Live Demo

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.

Install

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.

Use

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");
}

Modules

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.

Documentation

View the official documentation here.

To Do

  • Error detection and exception handling.

Additional Notes

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.

Issues/New Filters

Photon is always ready for new filters and functions, so if you'd like to contribute, just submit a Pull Request. :)

photon's People

Contributors

silvia-odwyer avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.