This method is used in compressing video files, too. It stores the data with frequency instead of spatial domains. Mpeg uses DCT to encode the spatial information into the frequency domain. The way you de-code it is to use the iDCT (Inverse Descrete Cosine Transform).