An opening does not destroy as much information as the erosion. An opening will discard small objects, but will keep the largest ones with a very similar shape in the original and the final image.
The opening by a disc,
Consider a disc as the structuring element. As shown in figure 1, the opening is achieved by sliding the disc inside the object and discarding all the parts where the disc cannot fit.
Figure 2 shows another example.
In this case, when the rectangle is totally included in the set
A closing is similar to a dilation but also less destructive. Small objects may be joined to larger ones.
A closing by a disc
As shown in figure 3, the closing is achieved by sliding the disc outside the particle and filling all the parts where the disc cannot fit into.