# Image Adaptive Threshold

Apply adaptive threshold operation that calculates threshold for small regions, suitable for varying lighting conditions

> Canonical page: https://elysiatools.com/en/tools/image-adaptive-threshold

- **Category:** Design

- **Keywords:** image, adaptive, threshold, local, binary, lighting, region, binarization

## Overview

The Image Adaptive Threshold tool performs local binarization on images, calculating unique thresholds for small pixel neighborhoods to effectively handle uneven lighting and shadows.

## Inputs

- **Image File** (file): Select an image file...
- **Block Size (odd number)** (number): Size of a pixel neighborhood that is used to calculate a threshold for the pixel (must be odd)
- **Constant** (number): Constant subtracted from the mean or weighted mean. Usually positive.
- **Adaptive Method** (select): Adaptive thresholding method to use

## When to use

- When an image has inconsistent lighting that makes global thresholding ineffective.
- When you need to extract text or fine details from documents with shadows or gradients.
- When preparing images for OCR or feature detection where local contrast is more important than overall brightness.

## How it works

- Upload your image file in a supported format like PNG, JPEG, or TIFF.
- Set the block size to define the neighborhood area for local threshold calculation.
- Choose between Gaussian or Mean methods to determine how the threshold is weighted within each block.
- Apply the constant value to fine-tune the sensitivity of the binarization process.

## Use cases

- Binarizing scanned documents with uneven page lighting or shadows.
- Isolating objects from backgrounds in images with complex, non-uniform illumination.
- Preprocessing images to improve the accuracy of optical character recognition (OCR) software.

## Frequently asked questions

### What is the difference between Gaussian and Mean methods?

The Mean method calculates the average of the neighborhood, while the Gaussian method uses a weighted sum based on a Gaussian distribution, often resulting in smoother edges.

### Why must the block size be an odd number?

An odd block size ensures there is a clear center pixel for the neighborhood calculation, which is required for the mathematical operation.

### What does the constant value do?

The constant is subtracted from the calculated mean; increasing it can help remove background noise or faint artifacts from the final binary image.

### Which file formats are supported?

The tool supports common image formats including JPEG, PNG, WebP, GIF, BMP, and TIFF.

### Can I process multiple images at once?

No, this tool is designed to process one image file at a time.

## Related tools

- [Image Box Blur](https://elysiatools.com/en/tools/image-box-blur): Apply box blur kernel for simple uniform averaging and fast noise reduction
- [Image Boolean AND](https://elysiatools.com/en/tools/image-boolean-and): Apply bitwise AND operation between two images to create intersection mask
- [Image Boolean NOT](https://elysiatools.com/en/tools/image-boolean-not): Apply bitwise NOT operation to invert all pixel values in an image
- [Image Boolean OR](https://elysiatools.com/en/tools/image-boolean-or): Apply bitwise OR operation between two images to create union mask
- [Image Boolean XOR](https://elysiatools.com/en/tools/image-boolean-xor): Apply bitwise XOR operation between two images to create difference mask
- [Image Noise Reduction](https://elysiatools.com/en/tools/image-noise-reduction): Reduce image noise using multiple algorithms including median, gaussian, and bilateral filtering
- [Bilateral Filter](https://elysiatools.com/en/tools/image-bilateral-filter): Apply bilateral filter for edge-preserving smoothing that reduces noise while maintaining image details
- [CLAHE Histogram Equalization](https://elysiatools.com/en/tools/image-clahe): Apply Contrast Limited Adaptive Histogram Equalization for local contrast enhancement

## Samples

- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Web Image Processing TypeScript Samples](https://elysiatools.com/en/samples/web-image-processing-typescript): Web TypeScript image processing examples including image read/save, scaling, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

## Related content

- [Binary Image Thresholding, Morphology, and Mask Tools](https://elysiatools.com/en/hubs/binary-image-thresholding-and-morphology): Turn images into binary masks, compare threshold methods, repair foreground shapes, and combine masks with morphological and Boolean operations.
