|
Post by Jairo on Jul 5, 2010 10:24:12 GMT -4
I have seen so many "anomalies" that were just JPEG artifacts, that I would like to study why the appear, and why they become so visible when one increases the saturaton of the image, forming blocks around regions without much details, like the sky.
Tutorials I found in the internet don't focus much on these features. They care much more about how to minimize them, but don't explain their behavior when a conspiracist twists random buttons in photoshop. Do you know any site or topic wich talks abot this?
Thanks.
|
|
|
Post by Joe Durnavich on Jul 5, 2010 10:40:53 GMT -4
The heart of JPEG compression is the Discrete Cosine Transform (DCT). See the Wikipedia page. In the Multidimensional DCTs section is an image that illustrates many of the artifacts that you see in overly-processed images: Wikipedia - Discrete Cosine Transform
|
|
|
Post by Joe Durnavich on Jul 5, 2010 10:46:24 GMT -4
|
|
|
Post by ka9q on Jul 7, 2010 22:44:50 GMT -4
It's not the DCT per se that creates these artifacts, but the quantization of its output.
The DCT is a fully reversible function; you can take its output and get back exactly what you put into it. But that wouldn't help compress the image. You get compression only when you reduce the accuracy of each number used to represent the output. (The output of any lossy compression scheme won't be the same as the input. It can't be.) The DCT was chosen because you can quantize its output a great deal without the eye noticing too much.
The DCT is closely related to the Fourier transform. Each "macroblock" in the image (typically 8x8 pixels) is run through the DCT, and the outputs represent the amplitudes (or "strengths") of each 2-dimensional "frequency" in that part of the image. The higher frequencies correspond to the smaller details, so those numbers can be more heavily quantized without you noticing. The lowest frequency is DC, i.e., the average brightness of the whole macroblock, and this is sent with the greatest precision.
Note that the compression doesn't just get rid of fine detail (though in principle it could, if you cranked the compression way up). It just represents its "intensity" less accurately. So when you look closely at the reconstructed image, you'll still see small details but they won't quite match the original. They won't even match the nearby pixels, especially at macroblock boundaries. This is how you get those artifacts, especially around sharp edges.
Does this help?
|
|
|
Post by Joe Durnavich on Jul 8, 2010 1:09:08 GMT -4
The Wikipedia JPEG page says in a caption, "The DCT transforms an 8×8 block of input values to a linear combination of these 64 patterns...". Is that the two-dimensional equivalent of saying that a complex audio waveform can be broken down into individual sine waves?
|
|
|
Post by Count Zero on Jul 8, 2010 18:27:47 GMT -4
I posted a simple experiment on the BAUT forum a few years ago to help understand .jpg artifacts.
|
|
|
Post by Ginnie on Jul 8, 2010 18:33:05 GMT -4
Interesting! I didn't realize that was why that effect happened - and I've been manipulating graphics on computers for years.
|
|
|
Post by ka9q on Jul 12, 2010 5:20:19 GMT -4
The Wikipedia JPEG page says in a caption, "The DCT transforms an 8×8 block of input values to a linear combination of these 64 patterns...". Is that the two-dimensional equivalent of saying that a complex audio waveform can be broken down into individual sine waves? Exactly. The DCT is almost the same thing as the FFT (which is commonly used to decompose an audio signal into a collection of sine waves) except that an image is 2-dimensional. Sine waves form one possible set of "basis functions" from which you can construct an arbitrary waveform by combining them at specified relative levels. The same is true with 2D images, except that your basis functions also have to be two-dimensional. The DCT basis functions look like checkerboards, though they only have square spaces when the horizontal and vertical frequencies are the same; the rest are rectangular. The DC component is a special case, as it represents the average brightness of the entire macroblock. Unlike the Fourier transform, which uses both sines and cosines, the DCT - discrete COSINE transform, uses only cosines. But the set is still big enough to synthesize any picture pattern you want.
|
|