gaussian_blur 0.1.1

Gaussian blur in linear time.
Documentation
  • Coverage
  • 80%
    4 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 8.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 269.24 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • frogtd/gaussian_blur
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • frogtd

Usage example with image

use image::{io::Reader, DynamicImage, ImageBuffer, ImageOutputFormat};
let kernel: [usize; 15] = [2, 5, 9, 14, 21, 27, 32, 34, 32, 27, 21, 14, 9, 5, 2];
let img = Reader::open("railway.jpg")?.decode()?.to_rgb8();
let (width, height) = (img.width() as usize, img.height() as usize);
let raw = img.into_raw();
let (raw, width, height) = blur(height, width, kernel, raw);
let img = DynamicImage::ImageRgb8(ImageBuffer::from_raw(width as u32, height as u32, raw).unwrap());
let mut writer = File::create("out.png").unwrap();
img.write_to(&mut writer, ImageOutputFormat::Png).unwrap();

License

Dual licensed under the Unlicense and MIT License.