[][src]Function raster::filter::gamma

pub fn gamma(src: &mut Image, gamma: f32) -> RasterResult<()>

Apply a gamma correction.

Gamma can be a value from 0.01 - 9.99. A gamma < 1.0 will darken and a gamma > 1.0 will lighten the image.

Examples

use raster::filter;

let mut image = raster::open("tests/in/sample.jpg").unwrap();
filter::gamma(&mut image, 2.0).unwrap();
raster::save(&image, "tests/out/test_filter_gamma.jpg").unwrap();

Before

After