Millions of lives might be saved if stained tissues could be detected quickly. Image classification algorithms may be used to detect the shape of cancerous cells, which is crucial in determining the severity of the disease. With the rapid advancement of digital technology, digital images now play a critical role in the current day, with rapid applications in the medical and visualization fields. Tissue segmentation in whole-slide photographs is a crucial task in digital pathology, as it is necessary for fast and accurate computer-aided diagnoses. When a tissue picture is stained with eosin and hematoxylin, precise tissue segmentation is especially important for a successful diagnosis. This kind of staining aids pathologists in distinguishing between different tissue types. This work offers a clustering-based color segmentation approach for medical images that can successfully find the core points of clusters through penetrating the red-green-blue (RGB) pairings without previous information. Here, the number of RGB pairs functions as a clusters’ number to increase the accuracy of current algorithms by establishing the automated initialization settings for conventional K-Means clustering algorithms. On a picture of tissue stained with eosin and hematoxylin, the developed K-Means clustering technique is used in this study (H&E). The blue items are found in Cluster 3. There are things in both light and dark blue. The results showed that the proposed technique can differentiate light blue from dark blue employing the ‘L*’ layer in L*a*b* Color Space (L*a*b* CS). The work recognized the cells’ nuclei with a dark blue color successfully. As a result, this approach may aid in precisely diagnosing the stage of tumor invasion and guiding clinical therapies