Recovering an image using IDCT through DCT coefficients
If you used dct2  on an image, or on each image channel separately for color images,  with the appropriate input format, then idct2 recover the original image (the transformation is invertible and orthogonal), up to rounding errors (similar discussion in Why is $\exp(\ln(x))−x\neq 0$ in floating point arithmetic?).

You can find for instance a demo below:

dataRGB = double(imread('autumn.tif'));
data = rgb2gray(dataRGB/255);
dataDct=  dct2(data);
dataDctIdct = idct2(dataDct);

subplot(2,2,1)
imagesc(data); 
xlabel('Original (grayscale)');
subplot(2,2,2)
imagesc(log(abs(dataDct))); 
xlabel('Original DCT');
subplot(2,2,3)
imagesc(dataDctIdct); 
xlabel('Original recovered');
subplot(2,2,4)
imagesc(data-dataDctIdct); 
xlabel('Difference'); 
colorbar
colormap gray