pix
Library for image conversion and compositing.
A raster image can be cheaply converted to and from raw byte buffers, enabling interoperability with other crates.
Many image formats are supported:
- Bit depth: 8- or 16-bit integer and 32-bit float
- Alpha: premultiplied or straight
- Gamma: linear or sRGB
- Color models:
RGB
/BGR
(red, green, blue)CMY
(cyan, magenta, yellow)Gray
(luma / relative luminance)HSV
(hue, saturation, value)HSL
(hue, saturation, lightness)HWB
(hue, whiteness, blackness)YCbCr
(used by JPEG)Matte
(alpha only)
Compositing with blending operations is supported for premultiplied images with linear gamma.
HWB Color Example
use SHwb8;
use SRgb8;
use Raster;
let mut r = with_clear;
for in r.rows_mut.enumerate
// Convert to SRgb8 color model
let raster = with_raster;