The magnitude of taking discrete cosine transform of an image two times is similar to the original Consider the following:

im = double(imread('lena.bmp'));
subplot(1,3,1), imshow(im,[]), title('original');
t1 = dct2(im);
subplot(1,3,2), imshow(log(abs(t1)+1),[]), title('DCT transform');
t2 = dct2(t1);
subplot(1,3,3), imshow(t2,[]), title('DCT(DCT) transform');


the output is shown below:



Could anyone explain why the result of the second order DCT is similar to the original image?

Thanks in advance!

P.S. The same thing happens with every 2N'th DCT.
It's beacuse the inverse discrete fourier transform (DCT) is almost identical to the forward DCT. So taking twice the transform will be similar to the original signal. In fact if you provide which DCT type (DCT-I, DCT-II etc) you have used, one can show the effect more explicitly.