JPEG DCT, Discrete Cosine Transform (JPEG Pt2)- Computerphile

Channel:Computerphile · Length:15:11 · Published:2015-05-22 · Views:699257

Watch on YouTube

Summary

Mike Pound explains the discrete cosine transform and how it underpins JPEG compression. It is part two of Computerphile's JPEG series.

Why HN recommends it

HN recommends it as an easy, clear intro to the DCT that finally made it click for several commenters.

I finally understood DCT after watching — HN, 2026

Computer vision, speech & NLP · Information theory & signal processing

Subtitles (excerpt)

In the last video, we talked about the beginnings of JPEG, so what do we do at the beginning of the process to start preparing for the discrete cosine transform, which is really how the lossy compression happens within a JPEG. We start with our RGB image, we convert that into YCbCr color space, which separates illuminance and chrominance. And then we can down sample the chrominance if we want, and we can kind of get away with quite a bit of down sampling there that people won't be able to see. The next step is the discrete cosine transform. Before we start talking about how images are compressed using the discrete cosine transform, it's much better just to start with a simple example of what a discrete cosine transform is and how it works. A cosine function, for anyone who isn't familiar with it, is a function that goes between 1 and -1. What we tend to do on this x-axis is go from 0, to pi, to 2*pi. This is in radians, those of you familiar with degrees, this is 180° at pi, and 360° at 2*pi. And the cosine wave looks like this. So it's 1 at 0, and then at pi, it goes down to -1, And then it goes back up to one at 2*pi. And it just goes on and on like this up and down as you increase.

On Hacker News

There's a series of videos showing the algorithm: [LINK] I finally understood DCT after watching [VIDEO] And someone created a "JPEG to PNG" tool that "finds the smoothest possible picture that encodes to the given JPEG file": [LINK] . I tried it with some very terribly compressed images, and the outputs were a lot better. — netsharc, 2026-07
It receives information about the spacial frequency content of the image. If you're unfamiliar, it's definitely worth looking into the specifics of how this works, as it's quite impressive! Here's a few relevant Wikipedia articles, and a Computerphile video: [LINK] [LINK] [VIDEO] — itishappy, 2024-04
There is a good video[1] from the Computerphile channel describing the concept in the context of JPEG. [1] [VIDEO] — boolemancer, 2023-12
The Computerphile channel has a nice series of videos on JPEG and one focusing on DCT [0]. It's a nice ans easy intro to the subject. [0]: [VIDEO] — skywal_l, 2022-12
Pretty cool! I would add Computerphile's Youtube Video as a watch after this: [VIDEO] . This is a part of their 4-video series on JPEG: [LINK] — walagran, 2020-08

Related videos