Function image_to_bytes

Source
pub fn image_to_bytes(img: PhotonImage) -> Vec<u8> 
Expand description

Save the image to a vector of bytes

§Arguments

  • img: The PhotonImage you wish to save.

§Example

use photon_rs::native::{open_image,image_to_bytes};

let img = open_image("img.jpg").expect("File should open");
// Save the image at a vec<u8>
let byt = image_to_bytes(img);