Cutout Function

pymatting.cutout

🔗

Signature

cutout(image_path, trimap_path, cutout_path)

Function Description

Generate a cutout image from an input image and an input trimap. This method is using closed-form alpha matting as proposed by [LLW07] and multi-level foreground extraction [GUCH20].

Parameters

  • image_path (str)
      Path of input image
  • trimap_path (str)
      Path of input trimap
  • cutout_path (str)
      Path of output cutout image

Example

>>> cutout("../data/lemur.png", "../data/lemur_trimap.png", "lemur_cutout.png")