pub fn add_selfie_to_image(mut image: &mut DynamicImage)
    -> Result<(), PromptoError> {

  match *image {
    DynamicImage::ImageRgba8(_) => {},
    _ => return Err(PromptoError::NotRgba),
  }

  let size = get_bounding_size(&image);

  let prompto = prompto_for_box(image.width(), image.height());
  let prompto = prompto.resize(size, size, FilterType::Lanczos3);

  let x = image.width() - prompto.width();
  let y = image.height() - prompto.height();

  let _r = mask(&mut image, &prompto, x, y)?;

  Ok(())
}
/// Add Prompto to the image buffer.
/// The image must be an RGBA image.
Add Prompto to the image buffer.
The image must be an RGBA image.
Add Prompto to the image buffer . The image must be an RGBA image .
pub fn add_selfie_to_image(mut image: &mut DynamicImage)
    -> Result<(), PromptoError> {
  match *image {
    DynamicImage::ImageRgba8(_) => {},
    _ => return Err(PromptoError::NotRgba),
  }
  let size = get_bounding_size(&image);
  let prompto = prompto_for_box(image.width(), image.height());
  let prompto = prompto.resize(size, size, FilterType::Lanczos3);
  let x = image.width() - prompto.width();
  let y = image.height() - prompto.height();
  let _r = mask(&mut image, &prompto, x, y)?;
  Ok(())
}
pub fn add_selfie_to_image ( mut image : & mut DynamicImage ) -> Result < ( ) , PromptoError > { match * image { DynamicImage :: ImageRgba8 ( _ ) => { } , _ => return Err ( PromptoError :: NotRgba ) , } let size = get_bounding_size ( & image ) ; let prompto = prompto_for_box ( image . width ( ) , image . height ( ) ) ; let prompto = prompto . resize ( size , size , FilterType :: Lanczos3 ) ; let x = image . width ( ) - prompto . width ( ) ; let y = image . height ( ) - prompto . height ( ) ; let _r = mask ( & mut image , & prompto , x , y ) ? ; Ok ( ( ) ) }
Add Prompto to the image buffer.
Add Prompto to the image buffer .
image
&mut DynamicImage
image
&mut DynamicImage