In mathematical morphology, the closing of a set (binary image) A by a structuring element B is the erosion of the dilation of that set,
The closing of the dark-blue shape (union of two squares) by a disk, resulting in the union of the dark-blue shape and the light-blue areas.
where and denote the dilation and erosion, respectively.
In image processing, closing is, together with opening, the basic workhorse of morphological noise removal. Opening removes small objects, while closing removes small holes.