> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Binarize Method of the ImageProcessingTools Object

This method converts an image to black and white.

## Syntax

```vb Visual Basic .NET theme={null}
Function Binarize( _
  Image As Image, _
  Mode As BinarizationModeEnum, _
  IsPhoto As Boolean, _
  SmoothTexture As Boolean, _
  Threshold As Integer _
) As Image
```

```cpp C++ theme={null}
HRESULT Binarize(
  IImage*              Image,
  BinarizationModeEnum Mode,
  VARIANT_BOOL         IsPhoto,
  VARIANT_BOOL         SmoothTexture,
  int                  Threshold,
  IImage**             Result
);
```

## Parameters

**Image**

\[in] This variable refers to the [**Image**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/image.md) object which is to be binarized.

**Mode**

\[in] Specifies the mode of binarization. See the description of the [**BinarizationModeEnum**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/binarizationmodeenum.md) constants.

**IsPhoto**

\[in] Specifies whether the image is a photo. The value of this parameter can be TRUE, only if the value of the *mode* parameter is [BM\_Default](https://docs.abbyy.com/flexi-capture/sdk/api-reference/binarizationmodeenum.md#bm-default) or [BM\_Version9](https://docs.abbyy.com/flexi-capture/sdk/api-reference/binarizationmodeenum.md#bm-version9).

**SmoothTexture**

\[in] Specifies whether a texture should be smoothed during binarization. The value of this parameter can be TRUE, only if the value of the *mode* parameter is [BM\_Default](https://docs.abbyy.com/flexi-capture/sdk/api-reference/binarizationmodeenum.md#bm-default).

**Threshold**

\[in] Specifies the threshold for binarization. The parameter is only used if the mode of binarization is [BM\_ByThreshold](https://docs.abbyy.com/flexi-capture/sdk/api-reference/binarizationmodeenum.md#bm-bythreshold). By default, the value of this parameter is 0.

**Result**

\[out, retval] A pointer to the [**IImage**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/image.md)**\*** pointer variable that provides access to the black-and-white image.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## See also

[**ImageProcessingTools**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageprocessingtools.md)
