In general, an inevitable side effect of the block-based transform coding includes grid noise in the monotone area, staircase noise along the edges, ringing around the strong edges, corner outliers, and edge corruption near the block boundaries. We propose a comprehensive postprocessing method for removing all the blocking-related artifacts in block-based discrete cosine transfer compressed image in the framework of overcomplete wavelet expansion (OWE) proposed by Mallat and Zhong [IEEE Trans. Pattern Anal. Mach. Intell 14(7), 710-732 (1992)], which is translationally invariant and can efficiently characterize signal singularities. We propose to use the wavelet transform modulus maxima extension (WTMME) to represent the image. The WTMME is extracted from the wavelet coefficients of three-level OWE of the blocky image. The artifacts related to blockiness are modeled and detected through multiscale edge analysis of the image using the information of both modulus and angle. Both the WTMME and the angle image are reconstructed accordingly using inter-/intraband correlation to suppress the influence of the distortions. Finally, the inverse OWE transform is performed for the processed image. Because the algorithm takes no assumption that the blockiness occurs at block boundaries, it is also applicable to video, where due to motion estimation and compensation, the grid noise may propagate into blocks. Extensive simulation and comparative study with 21 exiting relevant algorithms have demonstrated the effectiveness of the proposed algorithm in terms of subjective and objective quality of the resultant images.