Categories

Image Dilate

Apply dilation morphological operation to expand foreground objects in binary images

Click to upload file or drag and drop file here

Maximum file size: 10MB Supported formats: image/jpeg, image/png, image/webp, image/gif, image/bmp, image/tiff

Works best with binary (black and white) images

Number of times to apply dilation. More iterations = more expansion

Key Facts

Category
Design
Input Types
file, number
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

The Image Dilate tool performs a morphological operation that expands foreground objects in binary images, making them thicker or more prominent by adding pixels to their boundaries.

When to Use

  • When you need to bridge small gaps or holes within binary shapes.
  • When you want to increase the size of foreground features for better visibility.
  • When preparing binary masks for further image processing or analysis.

How It Works

  • Upload your binary image file (JPEG, PNG, WEBP, GIF, BMP, or TIFF).
  • Set the number of iterations to define how much the foreground objects should expand.
  • Process the image to apply the morphological dilation filter.
  • Download the resulting image with the expanded foreground features.

Use Cases

Repairing broken lines or fragmented shapes in scanned documents.
Enhancing the visibility of thin features in medical or scientific imaging.
Preparing binary masks for object detection or segmentation tasks.

Examples

1. Repairing Fragmented Text

Document Archivist
Background
A collection of scanned historical documents contains faint, broken text characters that are difficult to read.
Problem
The text is too thin and fragmented for OCR software to recognize accurately.
How to Use
Upload the binary scan and set the iterations to 2 to thicken the character strokes.
Example Config
iterations: 2
Outcome
The characters appear bolder and more connected, significantly improving OCR recognition rates.

2. Expanding Mask Features

Computer Vision Engineer
Background
A binary mask generated by a segmentation model has small gaps within the detected object boundaries.
Problem
The gaps prevent the mask from covering the entire object area.
How to Use
Upload the mask image and apply 1 iteration of dilation to close the gaps.
Example Config
iterations: 1
Outcome
The mask now fully encompasses the object, providing a solid silhouette for further analysis.

Try with Samples

image, png, jpg

Related Hubs

FAQ

What is image dilation?

Dilation is a morphological operation that adds pixels to the boundaries of objects in an image, effectively expanding the foreground.

What type of images work best?

This tool is designed for binary images (black and white), where the foreground is clearly distinguished from the background.

What does the 'iterations' setting do?

The iterations setting determines how many times the dilation process is applied; higher values result in more significant expansion.

Are there limits on the file size?

Yes, the maximum file size for uploads is 10 MB.

Can I process multiple images at once?

No, this tool processes one image file at a time.

API Documentation

Request Endpoint

POST /en/api/tools/image-dilate

Request Parameters

Parameter Name Type Required Description
imageFile file (Upload required) Yes Works best with binary (black and white) images
iterations number No Number of times to apply dilation. More iterations = more expansion

File type parameters need to be uploaded first via POST /upload/image-dilate to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-image-dilate": {
      "name": "image-dilate",
      "description": "Apply dilation morphological operation to expand foreground objects in binary images",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=image-dilate",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]