One of the drawbacks of the Discrete Cosine Transform (DCT) is visible block boundaries due to coarse quantization of the coefficients, Most restoration techniques for the removing blocking effect are variations of low-pass filtering, and as such, result in unnecessary blurring of the image, In this paper, we propose a new approach for reducing the blocking effect which can be applied to conventional transform coding, such as JPEG standardized coding, without introducing additional information or significant blurring, Our technique exploits the correlation between the intensity values of boundary pixels of two neighboring blocks, Specifically, it is based on the theoretical and empirical observation that under mild assumptions, quantization of the DCT coefficients of two neighboring blocks increases the expected value of the Mean Squared Difference of Slope (MSDS) between the slope across two adjacent blocks, and the average between the boundary slopes of each of the two blocks, The amount of this increase is dependent upon the width of quantization intervals of the transform coefficients, Therefore, among all permissible inverse quantized coefficients, the set which reduces the expected value of this MSDS by an appropriate amount is most likely to decrease the blocking effect, To estimate the set of unquantized coefficients, we solve a constrained quadratic programming problem in which the quantization decision intervals provide upper and lower bound constraints on the coefficients, Our approach is based on the gradient projection method which is motivated by the ordinary method of steepest descent for unconstrained problems, Computer simulations are used to evaluate the performance of the proposed technique, We have shown that from a subjective viewpoint, the blocking effect is less noticeable in our processed images than in the ones using existing filtering techniques.