Nowadays, edge detection through image processing is become core research due to its wide application in different fields such as medical and industries. In digital image processing, edge detection and feature extraction are considered active research areas. The different researcher has designed different methods (i.e.- Prewitt, Sobel, and Roberts) for edge detection in images for better visualization result. The basic purpose of the edge detection process is to interpret pixels values to find more significant, useful, and meaningful information about an image. The most important and strong feature in any image is called its edge, which can be detected by using different image processing algorithms. Therefore, a fast, simple, and robust method for edge detection become a basic need for edge detection and feature extraction. In this paper, we propose a morphologically based edge detection algorithm, which is based on three basic steps (i) Image Acquisition, (ii) Image enhancement, and (iii) Morphological edge detection filter. In the result, we compare the proposed algorithm with the existing spatial domain algorithm i.e.- Prewitt, Sobel, Laplacian of Gaussian, and kirsch to show the robustness and efficiency of the proposed morphological algorithm. Moreover, we did a quality-based comparison of all edge detection algorithms by using different quality matrix. After doing the comparison, it is clear that the performance of the proposed algorithm is better than the existing one in terms of time, efficiency, and quality.