3

I am studying jpeg compression and it seems to work by reducing high frequency components in images. Since noise is usually high frequency, does this imply that jpeg compression somewhat works on reducing noise in images?

Julia
  • 103
  • 1
  • 9
  • JPEG compresses images with 3 main techniques - removal of high-frequency components, quantization of color/luminance magnitudes and subsampling of color versus luminance. For shot/salt-pepper noise, yes it can remove some, but it introduces color quantization errors and block artifacts. – BitBank Jan 09 '16 at 14:13
  • Thank you for simple explanation, so it basically removes some form of noise and introduces another.. – Julia Jan 10 '16 at 10:44
  • I think I would phrase it as "JPEG compression can reduce shot noise, but at the same time introduces several types of errors" – BitBank Jan 10 '16 at 10:50

2 Answers2

2

JPEG compression can reduce noise by smoothing out the high-frequency components of the image, but it also introduces visual noise in the form of compression artifacts. Here is a zoomed-in (3x) view of part of my avatar (a high-quality JPEG) and part of your avatar (a PNG drawing), on the left as downloaded and on the right as compressed with ImageMagick using -quality 60. To my eye they both look "noisier" when JPEG-compressed.

enter image description here

Glenn Randers-Pehrson
  • 11,940
  • 3
  • 37
  • 61
  • So although jpg removes high frequency noise, it adds quantization noise appearing as artifacts in the compressed image... – Julia Jan 10 '16 at 10:42
  • Right. JPEG is not a tool for removing high frequency noise. Such tools do exist; questions about those are on topic at dsp.se (Signal Processing). – Glenn Randers-Pehrson Jan 10 '16 at 17:57
2

Strictly speaking, no.

JPEG does remove high frequencies (see below), but not selectively enough to be a denoising algorithm. In other words, it will remove high frequencies if they are noise, but also if they are useful detail information.

To understand this, it helps to know the basics of how JPEG works. First, the image is divided in 8x8 blocks. Then the discrete cosine transform (DCT) is applied. As a result, each element of the 8x8 block contains the "weight" of a different frequency. Then the elements are quantized in a fixed way depending on the quality level selected a priori. This quantization means gaining coding performance at the cost of losing precision. The amount of precision lost is fixed a priori, and (as I said above) it does not differenciate between noise and useful detail.

You can test this yourself by saving the same image with different qualities (which technically control the amount of quantization applied to each block) and see that not only noise is removed. There is a nice video showing this effect for different quality levels here: https://upload.wikimedia.org/wikipedia/commons/f/f3/Continuously_varied_JPEG_compression_for_an_abdominal_CT_scan_-_1471-2342-12-24-S1.ogv.

mhernandez
  • 607
  • 5
  • 14