In this paper, provide a simple and effective method for measuring blocking artefacts with an ideal 2-D step function in this study. First, a basic edge detection technique for measuring blocking artefacts is proposed. The ideal 2-D step function is chosen based on the presence of blocking artefacts in the edge image. The blocking artefact reduction algorithm in frequency domain is designed to extract all of the parameters required to detect the presence of blocking artefacts and replace the optimal step function with a ramp function by replacing the coefficient of the first row of horizontal blocks with the coefficient of the shifted block. The proposed strategy was tested on various standard benchmark photos and found to increase the perceptual quality of JPEG compressed images after blocking artefact removal with the proposed method.