Skip to main content

df_ocr_switcher/input/
image_file.rs

1use std::path::Path;
2use image::RgbImage;
3use crate::error::Result;
4
5/// Carica una singola immagine (PNG, JPEG, BMP, TIFF pagina singola, …)
6/// e la converte in RGB8.
7pub fn load_image(path: impl AsRef<Path>) -> Result<RgbImage> {
8    Ok(image::open(path)?.to_rgb8())
9}