In the present invention, 2N pixels (having signal levels V1 through V8), including a boundary pixel, that consist of N pixels on each side of a boundary and run orthogonally to the boundary are referenced to determine whether correction should be performed or not. If it is determined that the correction should be performed, the boundary pixel and M pixels on each side of the boundary pixel are used to perform the correction. In an image processing system for performing filtering on pixels belonging to a block, which is a unit of discrete cosine transform in image compression, the maximum value of differences between neighboring pixels in at least half, including a pixel of interest, of all the pixels composing a block to be processed is obtained. Differences between neighboring pixels in 2N pixels, including the pixel of interest, that run orthogonally to the boundary between blocks and consist of N pixels on each side of the boundary are calculated. The differences calculated are compared with a threshold corresponding to the maximum value to determine whether filtering should be performed. If it is determined that filtering should be performed, the pixel of interest and M pixels on each side of the pixel of interest are used to perform filtering. N is a positive integer and M is a positive integer smaller than N.