The boundary identification represents an interesting and difficult problem in image processing, mainly if two flat zones are separated by a gradual transition. The most common edge detection operators work properly for sharp edges, but can fail considerably for gradual transitions. In this work, we propose a method to eliminate gradual transitions, which preserves the number of the image flat zones. As an application example, we show that our method can be used to identify very common gradual video transitions such as fades and dissolves.