Transforms a bidimensional set of points in a 8x8 matrix to another matrix of 8x8 with entries being the the coeficients of a linear combination of cosines with different frequencies. This DCT at this stage is quantizied and get a lot of zeroes, so, RLE is optimal for compression and the lowest frequencies (which our eyes are more sensitive) are arranged at the top left , where the high frequencies are rounded to zero (quant stage) This programm includes de inverse DCT-III and it calculates the recovery of the image you can see both images in this directory to check the differences between the original and the decompressed REMEMBER that the matrix of pixels in fact it has COMPONENTS of the pixels , originaly they are bitmaps RGB but are transformed to Y-Cb-Cr and the one we CANNOT touch because is more sensitive to our eyes is the luminance (Y) , so we are supposing that pixels[][] is an array of Cb or Cr components. COMPILE gcc dct.c -lm -std=c99 -o dct See the data of the default set of 2D points in the program gnuplot> set dgrid3d 30,30 ; set hidden3d gnuplot> splot "img.plot" u 1:2:3 with lines Eduardo Ruiz Duarte