ecl-logo Documentation

ImageMask

ImageMask[inputImage, selectedColor, colorRange]outputImage

replaces all pixels in inputImage that are farther than the colorRange from selectedColor with the MaskColor.

ImageMask[inputImage, selectedColors, colorRange]outputImage

replaces all pixels in inputImage that are farther than the colorRange away from any selectedColors with the MaskColor.

ImageMask[inputImage, selectedColors, colorRanges]outputImage

replaces all pixels in inputImage that are farther than the colorRanges away from each selectedColors with the MaskColor.

Details

  • This is used to remove the background from images to make the foreground easier to detect.
  • Input
    Output
    General Options

Examples

Basic Examples  (3)

Remove background colors in an image:

Remove background colors in an image:

Remove background colors in an image (replacing them with a specific mask color):

Options  (3)

DistanceFunction  (2)

Remove background colors in an image using Manhattan disance metric:

Remove background colors in an image using Squared Euclidean disance metric:

MaskColor  (1)

Remove background colors in an image using a single threshold and multiple foreground colors: