#openimagedenoise #denoise #denoising

sys oidn

A wrapper for the Intel OpenImageDenoise image denoising library

9 stable releases

Uses new Rust 2021

1.4.3 Nov 19, 2022
1.4.2 Feb 15, 2022
1.4.1 May 22, 2021
1.3.0 Sep 26, 2020
0.1.0 Feb 9, 2019

#112 in Images

Download history 34/week @ 2022-08-19 43/week @ 2022-08-26 40/week @ 2022-09-02 54/week @ 2022-09-09 26/week @ 2022-09-16 17/week @ 2022-09-23 63/week @ 2022-09-30 50/week @ 2022-10-07 10/week @ 2022-10-14 19/week @ 2022-10-21 46/week @ 2022-10-28 56/week @ 2022-11-04 43/week @ 2022-11-11 62/week @ 2022-11-18 17/week @ 2022-11-25 21/week @ 2022-12-02

154 downloads per month
Used in crystal_ball

MIT license

22KB
495 lines

oidn

Crates.io Build Status

Rust bindings to Intel’s Open Image Denoise library.

Documentation

Rust docs can be found here.

Open Image Denoise documentation can be found here.

Example

The crate provides a lightweight wrapper over the Open Image Denoise library, along with raw C bindings exposed under oidn::sys. Below is an example of using the RT filter from Open Image Denoise (the RayTracing filter) to denoise an image.

extern crate oidn;

fn main() {
    // Load scene, render image, etc.

    let input_img: Vec<f32> = // A float3 RGB image produced by your renderer
    let mut filter_output = vec![0.0f32; input_img.len()];

    let device = oidn::Device::new();
    oidn::RayTracing::new(&device)
        // Optionally add float3 normal and albedo buffers as well
        .srgb(true)
        .image_dimensions(input.width() as usize, input.height() as usize);
        .filter(&input_img[..], &mut filter_output[..])
        .expect("Filter config error!");

    if let Err(e) = device.get_error() {
        println!("Error denosing image: {}", e.1);
    }

    // Save out or display filter_output image
}

The simple example loads a JPG, denoises it, and saves the output image to a JPG. The denoise_exr example loads an HDR color EXR file, denoises it and saves the tonemapped result out to a JPG. The denoise_exr app can also take albedo and normal data through additional EXR files.

Dependencies

~225–630KB
~15K SLoC