It is well known that at low bit rates, a block-based discrete cosine transform compressed image or video can exhibit visually annoying blocking and ringing artifacts. Low-pass filters are very effective in reducing the blocking artifacts in smooth areas. However, it is difficult to achieve a satisfactory result for ringing artifact removal using only an adaptive filtering scheme. This paper presents a neural network-based deblocking method that is effective on various types of images. The first step of this scheme is block classification that identifies each 8 × 8 block as one of the three types: PLAIN, EDGE or TEXTURE, based on its statistical characteristics. The next step is the reduction in the blocking and ringing artifacts by applying three trained layered neural networks to three different types of image areas. Comparing this method with other algorithms, the simulation results clearly show that the proposed algorithm is very powerful in effectively reducing both blocking and ringing artifacts while preserving the true edge and textural information and thus significantly improving the visual quality of the blocking images or videos.