This directory has various attempts at playing around with discrete cosine transforms (DFT) which is used in the JPEG file format. See for example http://en.wikipedia.org/wiki/Discrete_cosine_transform In a JPEG, the DFT is done on an 8x8 block of the image. These blocks can be easily seen when the JPEG is stored in low "quality", i.e. high compression. Just to see what would happen, I've done this DFT on the entire image. The dft_same.pl (which took me some fiddling to get right) verifies that the forward and backward transform leaves the image unchanged. Note that since the width and height aren't quite the same, the DFT matrix for the two directions are a bit different. For example, for an image which is 72 pixels wide, each of those rows is multiplied by a 72x72 DFT matrix. With a height of 96 pixels, this is done 96 times, each time with the same matrix multiplying a different row. The dft_blur image simply sets all the DFT components to zero beyond a given radial distance; that is, the higher frequencies are chopped. This is essentially just what a low-pass filter would do to a music signal. The image does get blurrier, as expected, but I'm also getting a funny green artifact along Tim's forhead, which I don't quite understand. Something to do with color spaces, I'd guess; we'd to better to do this in YUV colorspace rather than RGB. a PDF at http://www.poynton.com/ColorFAQ.html gives Y = 0.299 R + 0.587 G + 0.114 B U = -0.147 R - 0.289 G + 0.436 B V = 0.615 R - 0.515 G - 0.100 B R = Y + 0 U + 1.140 V G = Y - 0.396 U - 0.581 V B = Y + 2.029 U + 0 V