This is a simple Javascript implementation of the discrete cosine transform (DCT). DCT is used for a variety of applications, one of them being JPEG lossy compression. For more information refer to https://en.wikipedia.org/wiki/Discrete_cosine_transform
See http://home.htw-berlin.de/~s0537969/projects/dct/ for a live-demo. Tested for Chrome only and might not fully work in other browsers.