Discrete Cosine Transform
For each separate color component, the image is broken into 8 x 8 blocks that cover the entire image. These blocks form the input to the DCT. Typically, in the 8 x 8 blocks, the pixel values vary slowly. Therefore, the energy is of low spatial frequency. A transform that can be used to concentrate the energy into a few coefficients is the two-dimensional, 8 x 8 DCT. This transform, studied extensively for image compression, is extremely efficient for highly correlated data.

Conceptually, a one-dimensional DCT can be thought of as taking the Fourier transform and retaining only the real (cosine) part. The two-dimensional DCT can be obtained by performing a one-dimensional DCT on the columns and then, a one-dimensional DCT on the rows. The transformed output from the two-dimensional DCT is ordered so that the mean value (the DC coefficient) is in the upper left corner of the 8 x 8 coefficient block, and the higher frequency coefficients progress by distance from the DC coefficient. Higher vertical frequencies are represented by higher row numbers, and higher horizontal frequencies are represented by higher column numbers.