Why do JPEGs show blocky edges and colored speckles when zoomed in, while PNGs do not?
Asked 6/29/2020
14 views
2 answers
0
When I zoom into some JPEG images, I see chunky boundaries, blocky artifacts, and colored speckles such as magenta, yellow, and cyan. I don’t usually see this in PNG files. What in JPEG compression causes these artifacts, especially around edges and smooth areas like skies? Why are JPEGs still so widely used if PNG does not show the same problems?
Originally by user92812. Source · Licensed CC BY-SA 4.0
user92812
6y ago
2 Answers
5
This is the nature of lossy JPEG compression. The compression process works by splitting an image into 8x8 pixel patches, and compressing each of them individually, with no concern for the boundary conditions where each patch joins with its neighbors. The theory is that very small details can be modified and/or discarded without our visual system taking too much notice. As a result, discontinuities show up on the edges of these patches, and become more noticeable at higher compression (or, alternatively, lower quality) settings. In the extreme, the compression algorithm could theoretically convert each patch into a single color, which would be pretty similar to scaling a picture down by a factor of 8, and then scaling it back up by simply replicating pixels.
PNG compression, on the other hand, does nothing to modify the actual pixel colors. It applies a lossless compression algorithm to the image contents, which, depending on the contents of the image, can vary widely in its effectiveness - highly detailed images compress less, while a more uniform image would compress better. This is also why PNG images, even with their maximum compression settings, will still almost always be larger than a JPEG image with even moderate settings - it doesn't discard image details like JPEG does.
The CAPTCHA images you reference, are compressed at a relatively low-quality/high-compression setting, in order to make them as small as possible to preserve your network bandwidth (and storage on the server end). These settings would not generally be used for images intended for print/display/archival/etc.
Originally by user68706. Source · Licensed CC BY-SA 4.0
user68706
6y ago
0
Generated from our catalog & community — verify before relying on it.
Yes — this is mainly caused by JPEG’s lossy compression.
JPEG compresses an image in small 8×8 pixel blocks and simplifies fine detail within each block. At stronger compression settings, differences between neighboring blocks can become visible as “chunky” edges or block artifacts. Smooth areas such as skies can also show blotchy color speckles because subtle color information is being approximated or discarded.
PNG is different: it uses lossless compression, so it preserves pixel values exactly and does not create these block artifacts.
JPEG remains popular because it produces much smaller files for photos, where a small loss of detail is often acceptable. PNG is better when exact pixel fidelity matters, such as graphics, text, screenshots, or images with sharp edges, but it is usually less efficient for photographic images.
So in short: blockiness and colored speckling are normal signs of JPEG compression, especially at lower quality settings, while PNG avoids them because it is lossless.
Recommended products
UniqueBot
AI6y ago
Your Answer
Related Questions
Why do I see blocky sky gradients in Lightroom, even from RAW files?
Why does my Huawei P10 show blocky sky artifacts, especially when zooming?
Why does my RAW-to-JPEG export look noisier than the camera’s JPEG?
Should I shoot JPEGs in Super Fine or Fine on a Samsung S1050?
What causes red/green fringes along edges, and how can I reduce them?