This paper presents a novel edge detection technique for image classification and analysis, focusing on image segmentation by dividing images into distinct regions using various methods like thresholding and edge-based segmentation. The proposed method utilizes diagonal pixels in a 2x2 area for effective edge detection in grayscale images, demonstrating promising results across multiple test images. The study explores different approaches to threshold selection and highlights the importance and challenges of edge detection in digital image processing.