I am trying to compress a jpeg image using DCT in C++. The image pixels are saved in CImg. First, I cut the image in blocs of 8x8 pixels. Then I apply DCT in all the blocks.