picto
An image handling library.
Usage
Add the following to the Cargo.toml
in your project:
[]
= "0.2"
Supported Formats
Format | Decoding | Encoding |
---|---|---|
PNG | ✔ | ✔ |
JPEG | ✔ | ✘ |
GIF | ✔ | ✔ |
BMP | ✔ | ✔ |
TGA | ✔ | ✔ |
XYZ | ✔ | ✘ |
Documentation
Documentation is available here.
Example
The following example turns an image to gray scale (maintaining the alpha), then upscales it, and blurs it.
extern crate picto;
use ;
use ;
use *;
use env;
sRGB and friends
The RGB types and operations provided by picto assume the colors are given in linear RGB space, but many images contain the data in sRGB color space, this means some conversion needs to happen to have accurate operations.
The following code will load an image, and convert it to a Buffer
usable from
an sRGB space.
use picto;
use ;
let image =
.;