The method blur makes neighboring pixels of an image similar.
fn main() {
let img = image::open("my_image.jpg").unwrap();
let img2 = img.blur(10.);
img2.save("blur.jpg").unwrap();
}
Original image:
blur.jpg:
The parameter of blur controls how similar the neighboring pixels are.
Applying a larger parameter makes the pixels more similar.
The following picture shows the result when the parameter is 100
.
Use fast_blur for similar results but with faster runtime.
➡️ Next: Making Images Clearer
📘 Back: Table of contents