Why JPEG Artifacts Appear in Certain Colors More Than Others

Photo: Peter Xie / Pexels
Save a photograph of a red rose as a JPEG at medium quality and then look at the petals closely. The smooth gradient you started with will show blocky patches and smeared edges. Save a photograph of a gray concrete wall at the same quality setting and the degradation is nearly invisible. The two images went through identical compression — the same algorithm, the same quality parameter, the same math. The difference is not in the compression; it is in the interaction between JPEG's design assumptions and the specific properties of saturated red. Understanding why requires tracing JPEG's compression pipeline from the color space conversion at the beginning to the quantization step in the middle.
What JPEG Is Actually Compressing
JPEG is a lossy compression format: it permanently discards information to reduce file size. The discarded information is chosen by exploiting known properties of human perception — specifically, what the human visual system cannot notice (or notices only in extreme cases).
Lossy compression — a compression method in which some of the original data is permanently removed during encoding. The decoder cannot reconstruct the exact original. This contrasts with lossless compression (PNG, FLAC, ZIP) where the original is perfectly reconstructable. JPEG's lossy step is the quantization of DCT coefficients; everything else in the pipeline is lossless transformation.
The key design assumption in JPEG is this: the human visual system is approximately 4–10 times more sensitive to spatial detail in brightness (luminance) than in color (chrominance). This is a well-established psychophysical finding — our eyes have roughly 120 million rod cells sensitive to lightness and only 6–7 million cone cells sensitive to color, and the cone cells are concentrated in the central fovea rather than distributed across the retina.
JPEG exploits this asymmetry by keeping luminance data at high resolution while aggressively discarding chrominance (color) data. The mechanism is two-stage: first, a color space conversion separates luminance from chrominance. Second, chroma subsampling discards most of the chrominance data before the main compression step even begins.
Source: Wallace, G.K. (1991), "The JPEG Still Picture Compression Standard," IEEE Transactions on Consumer Electronics, Vol. 37 — the foundational paper describing the JPEG standard, its design rationale, and the psychophysical assumptions underlying the luminance/chrominance asymmetry.
The Color Space Conversion: From RGB to YCbCr
Camera sensors and displays work in RGB — three channels representing red, green, and blue intensity. JPEG does not compress RGB directly. Before any compression occurs, the image is converted to a different color space: YCbCr.
YCbCr — a color space that separates a pixel's information into three components: Y (luma, representing brightness), Cb (chroma blue, representing the deviation of the pixel's color from gray toward blue), and Cr (chroma red, representing the deviation toward red). A pixel's full color is encoded as the combination of Y, Cb, and Cr.
The conversion matters because it allows JPEG to apply different treatment to brightness information and color information independently. In RGB, the three channels are entangled — you cannot reduce one without affecting perceived brightness and color simultaneously. In YCbCr, the luma channel Y can be preserved at full resolution while Cb and Cr are downsampled without affecting perceived brightness at all.
The conversion formulas (from ITU-R BT.601) are approximately:
- Y = 0.299 × R + 0.587 × G + 0.114 × B
- Cb = −0.169 × R − 0.331 × G + 0.500 × B + 128
- Cr = 0.500 × R − 0.419 × G − 0.081 × B + 128
Notice that G (green) has the highest coefficient in the Y (luma) formula: 0.587. This reflects that the human eye is most sensitive to green light — the peak sensitivity of cone cells is near 555 nm, in the yellow-green range. Red has a moderate contribution (0.299) and blue has the smallest (0.114).
This is the first clue to why reds suffer: a strongly saturated red pixel has a high R value, low G value, and low B value. After conversion, it has moderate Y (luma), a high Cr value, and a moderate Cb value. Most of the "redness" is encoded in the Cr channel — which is about to be discarded.
Source: ITU-R BT.601-7 (2011), "Studio encoding parameters of digital television for standard 4:3 and wide-screen 16:9 aspect ratios" — the standard defining the YCbCr conversion matrix used in JPEG and video encoding.
Chroma Subsampling: Where Most of the Color Information Disappears
After color space conversion, JPEG encoders apply chroma subsampling — a deliberate reduction in the resolution of the Cb and Cr channels relative to the Y channel.
The notation for chroma subsampling describes a 4-pixel-wide reference region. The three numbers indicate: (1) the number of luma samples in the reference row, (2) the number of Cb samples in the top row, and (3) the number of Cb samples in the bottom row.
| Subsampling scheme | Color samples per 4 luma samples | Relative data |
|---|---|---|
| 4:4:4 | 4 (full resolution) | 100% (no subsampling) |
| 4:2:2 | 2 per row | ~67% of 4:4:4 |
| 4:2:0 | 1 per 2×2 block | ~50% of 4:4:4 |
| 4:1:1 | 1 per row of 4 | ~50% of 4:4:4 |
The most common JPEG setting — used by the vast majority of cameras and image editors — is 4:2:0. In 4:2:0, one Cb and one Cr value is assigned to a 2×2 block of four pixels. The color information for those four pixels is reduced from 4 independent values to 1 average value. Three-quarters of the chrominance data is discarded in this step.
The luma channel is preserved at full resolution: every pixel retains its own Y value.
This is the primary mechanism behind color-specific artifact visibility. At a high-contrast color edge — say, a red petal against a green background — the four pixels in a 2×2 block may span both sides of the edge. One pixel might be deep red (Cr = 170), and the adjacent pixel might be deep green (Cr = −80). In 4:2:0, both pixels share a single Cr value of approximately 45 — an average that represents neither color accurately. At the edge, both the red and green pixels are colorimetrically wrong by a large margin.
This error is called color bleeding or chroma blur: the color of one region "bleeds" into the adjacent region at the boundary. It is invisible in smooth-gradient regions because adjacent pixels have similar color values, making the averaging error small. It becomes visible only at sharp, high-contrast color transitions — which are disproportionately present in saturated-color imagery.
Source: Poynton, C. (2012), Digital Video and HDTV: Algorithms and Interfaces, 2nd ed., Morgan Kaufmann — the standard reference for chroma subsampling, YCbCr theory, and the human perceptual basis for luma/chroma asymmetry in video and image compression.
The Discrete Cosine Transform: Where the Blocking Comes From
Chroma subsampling explains color-specific artifacts. A separate mechanism — the Discrete Cosine Transform (DCT) and its quantization — explains the blocky, rectangular artifacts visible in compressed JPEGs at low quality.
Discrete Cosine Transform (DCT) — a mathematical transformation that converts a block of pixel values from the spatial domain (a grid of brightness values) into the frequency domain (a sum of cosine waves of different frequencies). The DCT itself is lossless. It is the subsequent quantization step that introduces loss.
JPEG processes each channel in non-overlapping 8×8 pixel blocks. Each block is transformed via DCT from 64 pixel values to 64 frequency coefficients. The DC coefficient (index [0,0]) represents the average brightness of the block. The AC coefficients represent progressively finer spatial detail — the highest-frequency coefficients represent detail at the scale of individual pixels.
After the DCT, each of the 64 coefficients is divided by a quantization table value and rounded to the nearest integer. The quantization table is derived from the user-specified quality setting. At lower quality settings, the quantization divisors are larger, so more coefficients round to zero — more detail is discarded.
The key insight: the quantization table for the luma channel uses smaller divisors (more precise quantization) than the tables for Cb and Cr. A typical JPEG encoder uses a luminance quantization table where DC and low-frequency AC coefficients are divided by small numbers (2–4), while applying a chrominance quantization table where the same coefficients are divided by larger numbers (10–20). The color channels are quantized more aggressively even before considering that they were already downsampled by 4:2:0.
When the compressed image is decoded, the inverse DCT reconstructs the 8×8 block from its remaining coefficients. Discarded high-frequency coefficients are treated as zero. The reconstruction is a smooth approximation of the original block — it cannot reproduce sharp transitions within the block. At block boundaries, two adjacent blocks that had different average values (DC coefficients) produce a visible seam: the blocking artifact.
Source: Pennebaker, W.B. and Mitchell, J.L. (1993), JPEG: Still Image Data Compression Standard, Van Nostrand Reinhold — the comprehensive technical reference for the JPEG standard, including quantization table design and DCT implementation.
Why Reds Are the Worst Case
Saturated red is the near-perfect storm of JPEG unfavorability. The damage compounds through the pipeline:
Step 1 — YCbCr conversion: Deep red encodes most of its "redness" into the Cr channel. The Y (luma) value of a pure saturated red (R=255, G=0, B=0) is only about 0.299 × 255 = 76 — not a high brightness. Most perceptible information about the pixel's identity is in Cr, not Y.
Step 2 — 4:2:0 subsampling: The Cr channel is subsampled. If the red pixel is at a sharp boundary, its Cr value is averaged with neighboring pixels of different colors. This averaging error is large precisely because the neighboring pixels have very different Cr values (green has low Cr; blue has very low Cr).
Step 3 — Chrominance quantization: The remaining Cr data, after subsampling, is quantized more aggressively than luma. The rounded coefficients further reduce the precision with which redness is encoded.
Step 4 — Ringing artifacts: At the sharp edge between a red region and a differently-colored background, the DCT quantization introduces a different artifact: ringing (also called Gibbs phenomenon). When a sharp transition is approximated by a limited sum of cosine waves (as happens when high-frequency DCT coefficients are zeroed out), the reconstruction overshoots and undershoots the true edge value, producing oscillating bands of incorrect brightness or color at the edge. These rings are more visible near saturated-color edges because the color contrast amplifies the perceptual salience of the oscillation.
Compare this to a gray-blue sky gradient: both brightness and color change smoothly. The 4:2:0 averaging error is small because neighboring pixels have similar Cb/Cr values. The quantization step discards mostly high-frequency fine-detail coefficients that are too fine to see anyway. The resulting compressed image looks nearly identical to the original.
| Image characteristic | Expected artifact visibility | Primary mechanism |
|---|---|---|
| Saturated red edge against white | High | 4:2:0 Cr channel loss + ringing |
| Saturated colors with sharp transitions | High | Chroma blur + 8×8 block boundary |
| Gray gradient | Very low | Low Cb/Cr variation; luma preserved |
| Muted blue sky | Low | Low saturation; Cb channel has small variation |
| Blue text on white background | Medium | Sharp luma edge creates ringing; Cb variation moderate |
| Skin tones | Low-medium | Near-neutral color; slight Cr variation visible at low quality |
| Red text on white background | Very high | Maximum Cr contrast + sharp luma edge + ringing |
Source: Blinn, J.F. (1998), "What's the Deal with the DCT?," IEEE Computer Graphics and Applications, Vol. 13 — accessible technical explanation of how the DCT operates in the JPEG context and why block boundaries become visible after quantization.
What Modern Formats Do Differently
JPEG's artifact patterns are consequences of specific design choices made in 1991. Modern formats have addressed each of these mechanisms.
JPEG 2000 replaced the block-DCT with a wavelet transform that operates across the entire image rather than in 8×8 blocks. This eliminates blocking artifacts entirely. The wavelet basis has no block boundaries, so quantization produces smearing rather than blocks — a perceptually less disruptive artifact type. JPEG 2000 never achieved mainstream adoption despite superior quality, partly due to patent licensing issues and partly due to the computational cost of wavelet transforms.
WebP (Google, 2010) uses transform coding from the VP8 video codec. It uses 4×4 pixel blocks (rather than JPEG's 8×8) for transform coding, which reduces the scale of blocking artifacts. WebP also supports lossless compression and transparency, which JPEG lacks. At equivalent visual quality, WebP files are typically 25–34% smaller than JPEG.
AVIF (AV1 Image File Format, 2019) uses intra-frame coding from the AV1 video codec. It supports 4:4:4 chroma subsampling (no color discarding) at all quality levels, larger transform blocks (up to 64×64) with overlapping filters that reduce blocking, and a broader dynamic range. At equivalent visual quality, AVIF files are typically 50% smaller than JPEG and show substantially less color artifacting on saturated content.
JPEG XL (2022) supports both lossless and lossy modes. Its lossy mode uses a 2D DCT-like transform but with adaptive block sizes and features specifically designed to reduce ringing at edges. JPEG XL achieves comparable quality to AVIF with similar file sizes and has the additional advantage of backward compatibility: a JPEG XL file can contain a recompressed version of an existing JPEG with no quality loss from the JPEG XL encoding itself.
Source: Alakuijala, J. et al. (2019), "JPEG XL next-generation image compression architecture and coding tools," Proceedings of SPIE Applications of Digital Image Processing, Vol. 11137 — technical description of JPEG XL's design, including block-adaptive transforms and edge-ringing mitigation.
Source: Mukherjee, D. et al. (2013), "The Latest Open-Source Video Codec from the WebM Project: VP9," SPIE Electronic Imaging — background on the VP8/WebP codec architecture that underlies WebP's improved artifact characteristics.
Frequently Asked Questions
Q: Why does re-saving a JPEG multiple times make it look progressively worse?
A: Each save-and-encode cycle starts with the quantization artifacts from the previous encode, then applies a new round of DCT quantization on top of them. The 8×8 block boundaries from the first encode do not align perfectly with what the second encoder would produce, so new artifacts layer over old ones. Additionally, the color values that survived the first encode are already approximations of the originals — quantizing approximations further compresses the error. After 4–5 re-saves at medium quality, ringing and blocking artifacts become clearly visible even in previously clean image areas.
Q: Does setting JPEG quality to 100 eliminate all artifacts?
A: Setting quality to 100 minimizes quantization artifacts substantially — most DCT coefficients are divided by 1 or 2 rather than large numbers, preserving nearly all spatial detail. However, if 4:2:0 chroma subsampling is still applied (which it is by default in many encoders even at quality 100), color artifacts at sharp saturation edges remain. To truly eliminate all lossy effects, you need either quality 100 with 4:4:4 chroma subsampling explicitly set, or a lossless format like PNG.
Q: Why does JPEG handle text poorly compared to photographs?
A: Text creates exactly the worst case for JPEG: extremely sharp, high-contrast edges at arbitrary angles, typically with pure black (or pure colored) regions immediately adjacent to pure white. These edges have steep luminance transitions that the DCT cannot represent efficiently — the ringing artifact around the edge makes letter outlines look fuzzy and fringe-colored. Photographs avoid this because natural scenes have gradients and soft edges that the DCT handles well. PNG is preferable for text and line art for this reason.
Q: What is the difference between blocking artifacts and ringing artifacts in JPEG?
A: Blocking artifacts are the visible seams at 8×8 pixel grid boundaries, caused by adjacent blocks having different average values (different DC coefficients) that create a step at the boundary. Ringing artifacts (Gibbs phenomenon) appear as oscillating bands of slightly wrong brightness or color around sharp edges within a block, caused by the absence of high-frequency DCT coefficients needed to represent the sharp transition. Blocking tends to be more visible at large uniform regions. Ringing is more visible at sharp color or brightness edges.
Q: Are JPEG artifacts visible in the same way on all screens?
A: No. High-resolution displays (above ~220 PPI at normal viewing distance) make blocking artifacts less visible because individual 8×8 pixel blocks are smaller in angular size. However, color artifacts from chroma subsampling are not pixel-count-dependent — they are a function of absolute color error, which is visible regardless of display resolution. Wide-color-gamut displays (P3 or Rec.2020) that can show more saturated colors may actually make chroma artifacts more visible because the gamut-expanded color error has a larger perceptible difference than on sRGB displays.
Q: When should I use PNG instead of JPEG?
A: Use PNG for images with sharp edges, text, logos, icons, screenshots, and any content with transparency. PNG is lossless — it introduces no compression artifacts. Use JPEG for photographs of natural scenes with smooth gradients, where the chroma subsampling and DCT artifacts are minimally visible and the file-size reduction is substantial. For new projects in 2026, AVIF or WebP offer better compression than JPEG with fewer artifacts, with broad browser support for both formats.
Read next:
Follow new articles
Add SciHub101 to your feed reader to see new science and technology stories.
About the Author
SciHub101 is an independent science and technology publication founded and edited by Buğra Sözeri, a software engineer and app developer based in Türkiye. AI tools assist with drafting and research. Source documentation in the existing archive is uneven, and articles are being reviewed and corrected. The Editorial Team byline identifies editorial responsibility; it does not certify specialist or independent human review. Where we compare products, anything built by our own team is labelled as such — see the editorial guidelines and About page for how corrections and disclosures work.
Related Articles

Why Linux Is Winning the Desktop War, Quietly
Linux holds roughly 3% of the global desktop market in 2026 — a number that sounds unimpressive until you realize it represents more active machines than all versions of macOS combined in some monthly surveys, and that the Steam gaming survey now records Linux at 5.33% of its user base. The shift isn't happening in corporate IT departments or on the evening news. It's happening one Steam Deck purchase, one developer workstation, and one Windows 10 end-of-life migration at a time.

What Happens to Your Data When a Tech Company Goes Bankrupt
When a tech company files for bankruptcy, the servers don't shut off — the data sitting on them becomes an asset on a balance sheet. In 2015, RadioShack attempted to sell 117 million customer records as part of its bankruptcy estate. Understanding what legally happens to your personal data in these proceedings, and what you can do about it, is more relevant in 2026 than it has ever been.

Complete Technology Guide 2026 — How Modern Tech Works
The complete guide to technology in 2026: how the internet, semiconductors, and quantum computing work, AI hardware, cybersecurity, and what's coming next.

Cybersecurity Threats in 2026: What the Data Actually Shows
Ransomware attacks tripled year-over-year between Q1 2024 and Q1 2025. The average time attackers spend exploiting a known vulnerability dropped from 700 days in 2020 to 44 days in 2025. AI is now on both sides of every attack. Here is what the current threat landscape looks like, what is driving it, and what organizations and individuals can do about it.

How the TikTok Algorithm Works in 2026
TikTok's For You Page (FYP) is powered by a recommendation engine that does one thing obsessively: predict which video you will watch longest. It uses watch time, replays, shares, and dozens of secondary signals to build a real-time model of your interests — then tests that model continuously by mixing in new content. Understanding the mechanics explains why the feed feels eerily accurate and why some videos reach millions of people who have never heard of the creator.

How to Build Your First Website With No Coding Experience
Building a website in 2026 requires zero coding knowledge for most use cases — but the choices you make in the first hour determine whether you're fighting the tool for years or growing smoothly. Here is what the options actually are, what they cost, and the path most first-timers should take.