Create Binary Mask (Image Analyst)

ArcGIS Pro 3.4 | | Help archive

Available with Image Analyst license.

Summary

Converts an input raster dataset to a binary raster. Pixels are labeled as either mask or background based on user-defined values.

Usage

  • This tool classifies an input raster as background or mask based on parameter values and outputs a binary mask raster in which a value of 1 indicates mask pixels and a value of 0 indicates background pixels.

    Note:

    Create the initial background of the input raster by first using a threshold function such as Remap, Binary Thresholding, Zonal Remap, Mask, math operators (<, <, >, >), and others.

  • When the output binary mask raster is applied to a raster, the pixels that overlap the background pixels of the binary mask raster will be turned into NoData.

  • Using this tool, you can eliminate small regions, shrink or expand regions, fill small background regions, and smooth boundaries.

  • The Flood Fill from Image Boundary parameter allows you to specify whether pixels within the mask boundary will be classified as background.

  • Use the Flood Fill from Image Boundary parameter if you want to create a mask of an island that maintains the water pixels on the island as mask values. The tool performs flood fill on the water pixels and ends when it reaches the land pixels. The output mask boundaries will remain intact.

    Flood Fill from Image Boundary parameter results
    The Flood Fill from Image Boundary parameter is checked (first image) and unchecked (second image).

  • The units for the Expand Mask and Expand Background parameter values are pixels. Values can be negative, which results in shrinking the mask and background.

  • To remove small groups of background pixels, use a negative value for the Expand Mask parameter, and a positive value for the Expand Background parameter.

Parameters

LabelExplanationData Type
Input Raster

The input raster dataset. If the input is multiband, the first band will be used by default.

Mosaic Layer; Raster Layer; Image Service; String; Raster Dataset; Mosaic Dataset
Output Mask Raster

The output binary raster dataset. Supported formats are TIFF, CRF, and PNG.

Raster Dataset
Background Value
(Optional)

The background value for the output raster. The default value is 0.

Double
Flood Fill from Image Boundary
(Optional)

Specifies how background pixel values will be determined.

  • Checked—Background pixel values will be determined by the flood fill operation, which fills the connected pixels from the image boundary to the mask boundary. Pixels inside the mask will not be converted to background regardless of their value.
  • Unchecked—Background pixel values will be determined by the specified background value. This is the default.

Boolean
Expand Background
(Optional)

The number of pixels that will be used to expand or shrink the background. Negative values will shrink the background.

Long
Expand Mask
(Optional)

The number of pixels that will be used to expand or shrink the mask. Negative values will shrink the mask.

Long
Minimum Mask Region Size
(Optional)

The number of connected pixels that will be used to define a mask region. Mask regions that are smaller than this size will be classified as background.

Long
Set Background as NoData
(Optional)

Specifies whether the background value will be set to NoData.

  • Checked—The background value will be set to NoData.
  • Unchecked—The background value will not be set to NoData. This is the default.

Boolean

Licensing information

  • Basic: Requires Image Analyst
  • Standard: Requires Image Analyst
  • Advanced: Requires Image Analyst

Related topics