What Is JPEG Compression?
Take a photograph at maximum quality JPEG and another at minimum quality JPEG. At first glance on a small screen, they may look identical. Zoom to 100 percent, and the differences become obvious: smeared textures, blocky artifacts around text and edges, color banding in gradients. Yet the minimum-quality file might be 1/20 the size. Understanding how JPEG compression achieves this reduction — and where it fails — is essential for every photographer who exports, shares, or archives images.
JPEG (Joint Photographic Experts Group) is a lossy compression standard ratified in 1992 that has dominated photographic image compression for over three decades. “Lossy” means the compression permanently discards information to achieve smaller file sizes. Unlike lossless formats (TIFF, PNG, lossless RAW) where the decompressed file is bit-identical to the original, a JPEG file can never be restored to its original, uncompressed state. Every compression cycle removes data, and every re-save at JPEG quality applies additional compression to already-compressed data.
Before JPEG, a single uncompressed 24-bit color image at 640 x 480 pixels occupied approximately 900 kilobytes — a significant portion of a 1990s hard drive. JPEG compression reduced this to 50-150 kilobytes while maintaining acceptable visual quality, enabling the growth of digital photography, web-based image sharing, and eventually the entire smartphone photography ecosystem. Today, JPEG remains the default output format for virtually every digital camera and the most widely supported image format on the web.
How It Works
JPEG compression operates in four sequential stages, each optimized to exploit a specific property of human vision.
Stage 1: Color space conversion. The image is converted from RGB (red, green, blue) to YCbCr, which separates luminance (Y, brightness) from chrominance (Cb and Cr, color difference). Human vision resolves luminance detail at approximately 4 times the spatial resolution of chrominance detail. JPEG exploits this by subsampling the chrominance channels — the most common scheme, 4:2:0, reduces chrominance resolution by half in both dimensions, immediately reducing data by one-third with minimal perceptible quality loss.
Stage 2: Discrete Cosine Transform (DCT). The image is divided into 8x8 pixel blocks (64 pixels each). Each block undergoes a mathematical transformation that converts spatial pixel data into frequency coefficients. Low-frequency coefficients represent smooth gradients and broad color areas. High-frequency coefficients represent fine detail, sharp edges, and texture. The DCT itself is lossless — it rearranges data, not discards it.
Stage 3: Quantization. This is the lossy step. Each frequency coefficient is divided by a value from a quantization table and rounded to the nearest integer. High-frequency coefficients are divided by larger values, rounding them more aggressively — often to zero. The quality slider in your export dialog controls the quantization table values. At quality 100, the divisors are small and few coefficients are zeroed. At quality 10, the divisors are large and most high-frequency coefficients are eliminated entirely. A quality setting of 85 typically zeros 60 to 70 percent of high-frequency coefficients while preserving all low-frequency data.
Stage 4: Entropy coding. The surviving coefficients are compressed using Huffman coding (standard JPEG) or arithmetic coding (less common, 5-10 percent more efficient). This stage is lossless — it reduces file size by encoding frequent values with shorter bit patterns, similar to ZIP compression.
File size scales roughly inversely with quality. A 24-megapixel image at quality 100 produces a JPEG of approximately 15-20 megabytes. At quality 92 (typical “high quality”), it drops to 6-10 megabytes. At quality 80, it reaches 3-5 megabytes. At quality 60, it falls to 1.5-2.5 megabytes. Below quality 50, artifacts become visible at normal viewing distances on high-resolution displays.
Practical Examples
Before: RAW file exported to JPEG at quality 95. Skin texture in a portrait retains pore-level detail. The gradient from a softbox-lit cheek to the shadowed jawline is smooth, with no visible banding. Fine fabric texture in a shirt is distinguishable at 100 percent magnification. File size: 8.2 megabytes for a 24-megapixel image.
After: Same file exported at quality 60. Skin texture shows smearing where the 8x8 block boundaries cross the face. The cheek-to-jawline gradient displays faint stair-stepping. Fabric texture has been replaced by an impressionistic blur that retains overall color but loses individual thread detail. Where the shirt meets a dark background, a faint halo — called a ringing artifact or mosquito noise — traces the edge. File size: 1.4 megabytes.
Before: Landscape with detailed foliage exported at quality 92. Individual leaves in a tree are distinguishable at 50 percent magnification. The sky gradient from deep blue to pale horizon shows no banding. The rocky foreground retains granular texture.
After: Same landscape exported at quality 50. The tree canopy becomes a mosaic of 8x8 blocks, each containing a uniform average of the leaf detail that once existed there. The sky gradient shows visible banding in 3 to 5 tonal steps where the original contained continuous gradation. Rocky foreground texture is softened to the point that it resembles watercolor painting.
Web delivery requires balancing quality against load time. A hero image on a photography portfolio site exported at quality 82-85 in a 2000-pixel-wide JPEG maintains visual quality at screen resolution while loading in 1 to 2 seconds on a broadband connection. The same image at quality 95 doubles the file size and load time with no perceptible quality difference at screen viewing distance. Google’s Core Web Vitals penalize pages with images that are unnecessarily large, making JPEG quality optimization a direct SEO concern.
Social media uploads apply their own re-compression to uploaded images. Instagram compresses images to approximately 1 megabyte at a maximum dimension of 1080 pixels. Uploading a high-quality JPEG means Instagram applies one round of re-compression. Uploading an already-compressed JPEG at quality 70 means the image undergoes two rounds of lossy compression, with cumulative artifact accumulation. For best results on platforms that recompress, uploading the highest quality source file (or PNG, which is lossless) minimizes generation loss.
Advanced Topics
Generation loss — the cumulative degradation from repeated JPEG compression — is a real concern in editorial workflows. Opening a JPEG, making an edit, and re-saving at the same quality does not produce the same file. Each save cycle requantizes the DCT coefficients, and the rounding errors accumulate. After 10 open-edit-save cycles at quality 85, fine detail is noticeably degraded and block artifacts begin appearing in areas that were clean in the original. Professional workflows avoid this by editing RAW or TIFF files and exporting to JPEG only as the final step.
Chroma subsampling schemes (4:4:4, 4:2:2, 4:2:0) have measurable impact on specific content. For photographs of natural scenes, 4:2:0 subsampling (half resolution in both chrominance axes) is virtually indistinguishable from 4:4:4 (full resolution in all channels). For images containing fine colored text, colored line art, or sharp red/blue patterns against contrasting backgrounds, 4:2:0 produces visible color bleeding. Graphic designers working with screenshots or text-heavy images should export at 4:4:4 subsampling or use PNG instead.
Progressive JPEG encoding reorders the compressed data so that the image loads in successively refined passes — a blurry approximation appears first, then sharpens as more data arrives. Baseline JPEG loads top-to-bottom in full resolution. For web delivery, progressive JPEGs provide a better perceived loading experience and are marginally smaller than baseline JPEGs at the same quality (typically 2-5 percent smaller due to more efficient Huffman table optimization across the full image). Most modern export tools default to progressive encoding.
JPEG XL is a next-generation format ratified in 2022 that supports lossless recompression of existing JPEG files (reducing their size by approximately 20 percent without any further quality loss), higher bit depths (up to 32-bit float), wider color gamuts (HDR support), and superior compression efficiency (30-60 percent smaller files than JPEG at equivalent visual quality). Browser support remains limited — Chrome removed its experimental JPEG XL support in 2023, while Safari added it in 2023. Until browser adoption broadens, traditional JPEG remains the safer choice for web delivery.
The 8x8 block boundary is the source of JPEG’s most visible artifact. When adjacent blocks are quantized to different values, visible discontinuities appear at their shared edges. Deblocking filters in post-processing can smooth these boundaries, but they also soften legitimate detail. The most effective countermeasure is exporting at a high enough quality that block boundaries remain below the perceptual threshold — quality 82 to 85 for most content, quality 90 or above for content with large smooth gradients like sky or studio backgrounds.
ShutterCoach Connection
ShutterCoach accepts both JPEG and RAW uploads and adapts its analysis to the file format. When reviewing a JPEG, it distinguishes between optical issues in the original capture (lens softness, motion blur, focus error) and compression artifacts introduced by JPEG encoding, so its feedback addresses the correct root cause rather than misattributing compression artifacts to camera technique.