# Image Erode

Apply erosion morphological operation to shrink foreground objects in binary images

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

- **Category:** Design

- **Keywords:** image, erode, morphology, binary, shrink, erosion, morphological, filter

## Overview

The Image Erode tool performs a morphological erosion operation to shrink foreground objects within binary images. By removing pixels from the boundaries of shapes, this utility helps isolate features, separate connected objects, or reduce noise in black-and-white image data.

## Inputs

- **Image File** (file): Works best with binary (black and white) images
- **Iterations** (number): Number of times to apply erosion. More iterations = more shrinkage

## When to use

- When you need to separate two objects that are touching or overlapping in a binary image.
- When you want to remove small, unwanted noise or 'salt' pixels from a thresholded image.
- When you need to reduce the size of foreground features to refine the precision of a shape or mask.

## How it works

- Upload your binary (black and white) image file to the tool.
- Set the number of iterations to define how aggressively the erosion should be applied.
- Process the image to shrink the foreground objects based on your chosen settings.
- Download the resulting image with the refined, reduced foreground shapes.

## Use cases

- Refining masks for computer vision training datasets.
- Cleaning up scanned documents or OCR inputs by removing stray noise.
- Separating connected components in a binary map or layout diagram.

## Frequently asked questions

### What is image erosion?

Erosion is a morphological operation that shrinks the white foreground areas of a binary image by removing pixels from their boundaries.

### Does this tool work on color images?

It is designed for binary images. If you upload a color image, it may not produce the expected morphological results.

### What do the iterations represent?

Iterations determine how many times the erosion process is repeated; higher values result in more significant shrinkage of the foreground objects.

### What file formats are supported?

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

### Can I increase the size of objects instead?

No, this tool specifically performs erosion (shrinking). To increase object size, you would need a dilation tool.

## Related tools

- [Image Gradient Overlay](https://elysiatools.com/en/tools/image-add-gradient): Add gradient overlay effects to images with customizable colors, directions, and blend modes
- [Image Masking Effect](https://elysiatools.com/en/tools/image-add-masking): Apply masking effects to images using shapes, gradients, or custom masks for creative compositions
- [Add Noise Effect](https://elysiatools.com/en/tools/image-add-noise): Add various types of noise effects to images with customizable intensity and parameters
- [Image Binary Converter](https://elysiatools.com/en/tools/image-binary): Convert images to binary (black and white) with customizable threshold and options
- [Image Blur](https://elysiatools.com/en/tools/image-blur): Add blur effects to images with adjustable blur strength and multiple blur types
- [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

## 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.
