Abstract : In recent years, variational methods, i.e., the formulation of problems under optimization forms, have had a great deal of success in image processing. This may be accounted for by their good performance and versatility. Conversely, mathematical morphology (MM) is a widely recognized methodology for solving a wide array of image processing-related tasks. It thus appears useful and timely to build bridges between these two fields. In this article, we propose a variational approach to implement the four basic, structuring element-based operators of MM: dilation, erosion, opening, and closing. We rely on discrete calculus and convex analysis for our formulation. We show that we are able to propose a variety of continuously varying operators in between the dual extremes, i.e., between erosions and dilation; and perhaps more interestingly between openings and closings. This paves the way to the use of morphological operators in a number of new applications.