imforge.cut module

imforge.cut.cut_out(image, *polygons, fillcolor=None)

Cut out the areas delimited by given list of polygons: i.e. fill image pixels outside of given polygons with the given fill color.

Parameters
imforge.cut.cut_out_cv2(image, *polygons, fillcolor=None)

Cut out the areas delimited by given list of polygons: i.e. fill image pixels outside of given polygons with the given fill color.

Parameters
  • image (numpy.ndarray) – the numpy array representing the image

  • polygons (list[tuple[int,int]]) – the polygons to cut out

  • fillcolor – the color to use for filling area outside of polygons

imforge.cut.cut_out_pil(image, *polygons, fillcolor=None)

Cut out the areas delimited by given list of polygons: i.e. fill image pixels outside of given polygons with the given fill color.

Parameters
  • image (PIL.Image.Image) – the image to cut out

  • polygons (list[tuple[int,int]]) – the polygons to cut out

  • fillcolor – the color to use for filling area outside of polygons