Skip to main content

imwrite

Function imwrite 

Source
pub fn imwrite(
    path: impl AsRef<Path>,
    image: &Tensor,
) -> Result<(), ImgProcError>
Expand description

Write an ImageU8 to a file. Format inferred from extension (png, jpg, bmp, etc.). Write a [H, W, C] f32 tensor (values in [0, 1]) to disk.

Format is inferred from the file extension. Channels must be 1 (grayscale) or 3 (RGB).

Accepts any path-like type (&str, String, &Path, PathBuf, etc.).