Peritumoral areas or microenvironments surrounding melanoma are unexplored and partially understood, so that, in the following paper, an algorithm that predicts the trend of the melanoma progression is proposed. Additionally, in case of melanoma the peritumoral area is significantly correlated with the texture that belongs inside the skin lesion. The proposed algorithm analyses the region of interest (ROI) with Normalized 2-D cross-correlation (NCC) method and predicts the pattern in the peritumoral area which is most similar with the texture of the melanoma. An important step is the detection of the peritumoral area, in which case, the mathematical morphology techniques were proposed. The verifying of similarity between the samples cropped from inside the melanoma and peritumoral area with Structural Similarity Index (SSIM) was performed. The main advantage of the proposed algorithm is that it can be applied on different medical image types and tumors. The algorithm was tested on two datasets 7-Point and PH2, and two computes.