1. A method for encoding an image including a plurality of pixels, the method comprising the steps of: classifying each pixel of the image as one of a plurality of pixel classifications; defining the image as a plurality of blocks of pixels; classifying each block as one of a plurality of block classifications based on the pixel classifications of pixels in that block; transforming each block to produce a transformed matrix including transform coefficients for each block; quantizing the transform coefficients for each transformed matrix using a selected quantization table according to the block classification of its corresponding block, to produce a quantized matrix; performing an inverse transform on each quantized matrix to produce a filtered image; and performing a JPEG compression on the filtered image.