Elysia Tools

Browse tools, examples, visual explainers, and topic guides from one clear workspace.

Top Categories

Hubs

Language
ZHDERUPTENFRES

Elysia Tools

Navigation

Design

Image Morphological Closing

· Last updated:2025-10-29

Apply morphological closing operation (dilation followed by erosion) to fill small holes and connect nearby objects

Execution

Run this tool

Fill in the form, run the tool, and review the result in one place.

Samples

Examples that match this tool

Related

Continue with connected tools and hubs

Written by the Elysia Tools team
Image355
Binary52

Tool usage guide

Learn when to use this tool, what it supports, and how real users apply it.

Key facts

Category
Design
Input types
file, number, select
Output type
file
Sample coverage
4
API ready
Yes

Overview

The Image Morphological Closing tool performs a sequence of dilation followed by erosion to clean up binary images. This process effectively fills small holes, gaps, and noise within shapes while connecting nearby objects, making it an essential utility for image preprocessing and computer vision tasks.

When to use

  • When you need to remove small black noise or holes from white objects in a binary image.
  • When you want to bridge small gaps between fragmented parts of an object to create a solid shape.
  • When preparing images for contour detection or segmentation where object continuity is required.

How it works

  1. 1Upload your binary image file (JPEG, PNG, WEBP, etc.) to the tool.
  2. 2Adjust the number of iterations to control the intensity of the hole-filling effect.
  3. 3Select the kernel size (Standard 3x3 or Large 5x5) to define the scope of the morphological operation.
  4. 4Process the image to download the cleaned, closed version.

Use cases

  • Cleaning up scanned documents or text to ensure characters are solid and readable.
  • Refining masks in image segmentation workflows to remove internal noise.
  • Connecting broken lines or fragmented shapes in technical drawings or schematics.

Compare alternatives

  • Convert images to binary (black and white) with customizable threshold and options

  • Apply bitwise AND operation between two images to create intersection mask

  • Apply bitwise NOT operation to invert all pixel values in an image

Who it's for

Best for

  • Convert images in the browser.
  • Workflows where Kernel Size matters, such as Standard (3x3) or Large (5x5 equivalent).
  • Repeatable jobs with images and the same settings every time.

Not ideal for

  • Fully automated batch jobs — this page is built for interactive use; use the API endpoint for scripts.
  • Files in formats this tool does not accept — it works with .jpg, .png, .webp, .gif input.

Edge cases & common failures

  • Very large files

    Large files take longer and can hit browser memory limits — try a smaller sample first.

  • Skipping the output check

    Compare the first rows or pages of the output with the input before using it in production.

  • Files from unusual exporters

    Some files use format variants that do not convert cleanly — if the output looks wrong, re-save the file from the app that created it and try again.

Examples

1. Restoring Fragmented Text

Data Entry Specialist

Background

A batch of scanned receipts contains text with broken characters due to low-quality printing.

Problem

The OCR software fails to recognize characters because of small gaps and holes within the letters.

How to use

Upload the scanned image and apply the closing operation with 1 iteration and the standard 3x3 kernel.

iterations: 1, kernelType: 'default'

Outcome

The small gaps in the characters are filled, resulting in solid, legible text that the OCR software can process accurately.

2. Cleaning Binary Segmentation Masks

Computer Vision Researcher

Background

A machine learning model generated a segmentation mask for an object, but the mask contains internal noise and small holes.

Problem

The mask is not a solid shape, which interferes with downstream object measurement tasks.

How to use

Upload the binary mask and use the large 5x5 kernel with 2 iterations to ensure all internal holes are filled.

FAQ

What is morphological closing?

It is a mathematical morphology operation that performs dilation followed by erosion, which helps to close small gaps and fill holes in foreground objects.

What type of images work best?

Binary images (black and white) provide the most predictable results, as the operation is designed to distinguish between foreground and background pixels.

How do iterations affect the output?

Increasing the number of iterations makes the closing effect stronger, filling larger holes and connecting more distant objects.

What is the difference between kernel sizes?

The Standard 3x3 kernel provides subtle closing, while the Large 5x5 kernel covers a wider area, making it more effective for filling larger gaps.

Will this tool change my image resolution?

No, the tool modifies the pixel values based on morphological rules but maintains the original dimensions of your input image.

Hub

Binary Image Thresholding, Morphology, and Mask Tools

Turn images into binary masks, compare threshold methods, repair foreground shapes, and combine masks with morphological and Boolean operations.

Home
Tools3212
Samples593
Visualizations471
Viewers103
Hubs239
Tags333
Images, Audio & Video657

Image, audio, and video processing, conversion, and optimization tools

Math, Date & Finance647

Calculators, numerics, date logic, statistics, and finance tools

Design & Color298

Color, layout, graphics, visual styling, and design helper tools

Text & Writing209

Writing, cleanup, formatting, extraction, and text analysis tools

Developer & Web193

Developer utilities, networking, web debugging, and automation helpers

Conversion & Encoding175

Format, file, archive, unit, and encoding conversion tools

Lead Generation Quiz Launch and Contact Handoff
Memorial Drafts: Family Review and Print Handoff
Private Habit Records: Backup, Restore and Sharing Review
Article to X and LinkedIn Drafts: Fact Review and Handoff
Markdown Interactive Deck Review and Offline Handoff

© 2026 Elysia Tools. All rights reserved.

DocsPricingAboutTerms of ServicePrivacy PolicyCookiesContact
Python

Web Image Processing Python Samples

Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion

TypeScript

Web Image Processing TypeScript Samples

Web TypeScript image processing examples including image read/save, scaling, and format conversion

Java

Android Image Processing Java Samples

Android Java image processing examples including reading/saving images, scaling, and format conversion

Kotlin

Android Image Processing Kotlin Samples

Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

Design

Image Binary Converter

Convert images to binary (black and white) with customizable threshold and options

Design

Image Boolean AND

Apply bitwise AND operation between two images to create intersection mask

Design

Image Boolean NOT

Apply bitwise NOT operation to invert all pixel values in an image

Design

Image Boolean OR

Apply bitwise OR operation between two images to create union mask

iterations: 2, kernelType: 'large'

Outcome

The mask becomes a solid, continuous shape with all internal noise removed, ready for precise area calculation.

Image Binary Converter
Image Boolean AND
Image Boolean NOT