Function photon_rs::noise::add_noise_rand
source · pub fn add_noise_rand(photon_image: PhotonImage) -> PhotonImage
Expand description
Add randomized noise to an image. This function adds a Gaussian Noise Sample to each pixel through incrementing each channel by a randomized offset. This randomized offset is generated by creating a randomized thread pool. [WASM SUPPORT NOT AVAILABLE]: Randomized thread pools cannot be created with WASM using the code used currently, but a workaround is oncoming.
Arguments
img
- A PhotonImage.
Example
// For example:
use photon_rs::native::open_image;
use photon_rs::noise::add_noise_rand;
use photon_rs::PhotonImage;
let img = open_image("img.jpg").expect("File should open");
let result: PhotonImage = add_noise_rand(img);