JPEG Compression Artifacts Explained: What They Are and How to Detect Them
Why your images look worse every time you save them — and what's actually happening at the pixel level.
The Most Popular Image Format Has a Dirty Secret
JPEG is everywhere. It's the default format for digital cameras, smartphones, web browsers, messaging apps, and social media platforms. Roughly 73% of all images on the web are JPEGs. And every single one of them is damaged.
Try it free: Quality Analyzer — Analyze compression quality and detect artifacts. Runs in your browser, no signup needed.
That's not an exaggeration. JPEG is a lossy compression format — it achieves small file sizes by permanently discarding image data. The compression algorithm makes calculated bets about what your eyes won't notice, and throws that information away. At high quality settings, the trade-off is invisible. At low quality settings, or after multiple rounds of resaving, the damage becomes obvious: blocky grids, banded gradients, smeared edges, and an overall muddy appearance.
These are compression artifacts — and recognizing them matters for photography, design, forensics, and anywhere image quality counts. This guide explains what each artifact type looks like, why it happens, and how to detect degradation using tools like our Quality Analyzer.
💡 Did you know?
JPEG stands for Joint Photographic Experts Group — the committee that created the standard in 1992. Over 30 years later, it remains the dominant image format despite being fundamentally lossy. Modern alternatives like WebP, AVIF, and HEIF offer better compression at the same quality, but JPEG's universal compatibility keeps it entrenched.
How JPEG Compression Actually Works
Before diving into artifacts, you need to understand the compression pipeline. JPEG compression happens in four stages, and each stage contributes to potential quality loss.
Color space conversion. The image is converted from RGB (red, green, blue) to YCbCr — a format that separates brightness (luminance) from color (chrominance). Human eyes are more sensitive to brightness than color, so JPEG exploits this by downsampling the color channels. The most common scheme, 4:2:0 chroma subsampling, cuts color resolution in half both horizontally and vertically. This alone reduces data by 50% with minimal visible impact on most photos.
Block splitting. The image is divided into a grid of 8×8 pixel blocks. Each block is processed independently — and this is the origin of JPEG's most recognizable artifact, the blocking pattern. Every JPEG image is secretly a mosaic of tiny 8×8 tiles, and at low quality settings, the seams between tiles become visible.
DCT and quantization. Each 8×8 block is transformed using the Discrete Cosine Transform (DCT), which converts pixel values into frequency coefficients. Low frequencies represent smooth gradients; high frequencies represent sharp edges and fine detail. The quality setting controls a quantization table that determines how aggressively high-frequency data is rounded — and rounding means permanent data loss. At quality 100, almost nothing is discarded. At quality 10, most detail is gone.
Entropy coding. The quantized coefficients are compressed further using lossless Huffman coding or arithmetic coding. This final stage doesn't introduce any artifacts — it's just efficient data packing. All the damage happens in the quantization step.
The Four Types of JPEG Artifacts
JPEG compression creates four distinct artifact types, each caused by a different aspect of the compression pipeline. Learning to recognize them helps you assess image quality and identify over-compressed or recompressed images.
Blocking (Block Boundary Artifacts)
The most recognizable JPEG artifact. Because JPEG processes 8×8 pixel blocks independently, adjacent blocks can end up with noticeably different average values — especially in smooth areas like sky, skin, or studio backgrounds. The result is a visible grid pattern where block edges don't match their neighbors.
Blocking is most visible at quality settings below 50, but even moderate compression (quality 60-70) can produce faint blocking in areas with subtle gradients. Blue sky is the classic stress test — if you see a faint checkerboard pattern in a clear sky, you're looking at blocking artifacts. Our Quality Analyzer can measure this objectively by detecting discontinuities at block boundaries.
Blocking also plays a role in forensic analysis. Because different regions of a manipulated image may have been compressed at different quality levels, inconsistent blocking patterns can reveal image splicing. This is one of the principles behind Error Level Analysis (ELA), which our ELA Scanner visualizes.
Banding (Posterization)
Smooth gradients — the gentle transition from one color to another — are expensive in terms of high-frequency DCT coefficients. When JPEG quantization removes those coefficients, the smooth gradient collapses into a series of flat bands, like a topographic map. Instead of a smooth sky gradient from deep blue to pale blue, you see 4-5 distinct blue stripes.
Banding is especially problematic for images intended for print, where it becomes obvious on paper. If you're preparing images for printing, checking for banding with our Print Readiness Scanner can save you from expensive reprints. Banding is technically a quantization artifact — the continuous range of color values is being reduced to a smaller set of discrete steps.
Ringing (Gibbs Phenomenon)
When JPEG removes high-frequency DCT coefficients near sharp edges (text on a background, a dark branch against bright sky), the reconstruction overshoots and undershoots around those edges. This creates a halo effect — alternating light and dark bands radiating outward from the edge, like ripples in water.
Ringing is most visible around text rendered on a solid background, which is why JPEG is a poor choice for screenshots, diagrams, and UI mockups. PNG (lossless) produces dramatically better results for this type of content. If you're working with screenshots, our screenshot detection guide covers format considerations.
Mosquito Noise
Named for its visual resemblance to a swarm of insects, mosquito noise appears as shimmering, shifting patterns near high-contrast boundaries — especially in video, but also visible in still images as random color speckles around edges. It's caused by the same frequency truncation as ringing, but manifests as scattered noise rather than coherent halos.
Mosquito noise is particularly common in images that have been compressed, decompressed, and recompressed (generational loss). Each compression cycle introduces slightly different noise patterns, and they accumulate. Social media platforms are notorious for this — an image posted to Instagram, screenshotted, posted to Twitter, and screenshotted again has gone through multiple compression cycles and will show significant mosquito noise around sharp elements.
Want to see how compression has affected your image? Analyze quality, sharpness, and compression artifacts instantly.
Check Image Quality →Lossy vs. Lossless: When Format Choice Matters
The fundamental distinction in image compression is between lossy and lossless approaches, and choosing wrong can either bloat your files or destroy your image quality.
Lossy formats (JPEG, WebP lossy, HEIF, AVIF lossy) achieve dramatic size reduction — often 10-20× smaller than the original — by permanently discarding data. The compression algorithm decides what you probably won't notice, removes it, and the original cannot be recovered. Every save cycle discards more. Lossy formats are ideal for photographs destined for screens where file size matters: web pages, social media, messaging.
Lossless formats (PNG, TIFF, WebP lossless, AVIF lossless, BMP) compress using reversible algorithms. The decompressed file is bit-for-bit identical to the original. No data is ever lost, no matter how many times you open and save. The trade-off: files are 3-10× larger than equivalent lossy versions. Lossless is essential for archival storage, forensic preservation, medical imaging, and any workflow where the image will be edited multiple times.
💡 Did you know?
A 12-megapixel photo straight from a camera sensor is roughly 36 MB uncompressed. Saved as lossless PNG, it drops to about 15-20 MB. As a JPEG at quality 85, it drops to 2-4 MB — a 10× reduction. At quality 30, it might be 200 KB — but with severe visible artifacts. The quality slider isn't linear either: the difference between quality 95 and 85 is usually invisible, while the difference between 40 and 30 is dramatic.
A common mistake is editing in a lossy format. If you open a JPEG, adjust the colors, and save it as JPEG again, you've just applied lossy compression twice. The second save doesn't just re-encode the changes — it recompresses the entire image, and the quantization doesn't align perfectly with the first pass. This is why photographers shoot in RAW, edit in RAW or TIFF, and export to JPEG only as the final output step.
Modern formats blur the line. WebP and AVIF support both lossy and lossless modes in the same format. HEIF (used by iPhones since 2017) offers better quality-per-byte than JPEG but has limited browser support. For web delivery, these newer formats are increasingly the right choice, but JPEG remains the universal fallback. You can check what format and quality settings were used on any photo by examining its EXIF metadata.
Generational Loss: Death by a Thousand Saves
Every time a JPEG is opened, modified, and resaved, it undergoes another compression cycle. This cumulative degradation is called generational loss, and it's one of the most common causes of poor image quality online.
The mechanics are subtle. Even saving at the same quality level introduces new artifacts because the 8×8 block grid may not align with the previous encoding (if the image was cropped by a non-multiple of 8 pixels), and quantization rounding errors compound. After 5-10 resave cycles at quality 80, degradation is noticeable. After 20-30 cycles, the image looks like it was photographed through frosted glass.
Social media amplifies this problem. Most platforms apply their own compression to uploaded images — Facebook, Instagram, Twitter, WhatsApp, and Telegram all re-encode JPEGs at their own quality settings, often aggressively. An image that goes from camera → desktop editor → email → social media → screenshot → reshare has been through at least 4-5 compression cycles. The platform metadata stripping guide explains what each platform does to your images.
To minimize generational loss, always keep a lossless master copy. Edit and reshare from the original, not from a previously compressed version. If you need to check how much quality has been lost, tools like our Quality Analyzer can assess current image quality metrics and flag degradation.
Detecting Compression Artifacts
Sometimes you can see artifacts plainly. Heavy blocking in a sky gradient, obvious ringing around text — these are apparent to the naked eye. But moderate artifacts are harder to spot, especially on small screens or in busy images where texture masks the damage.
Several approaches help detect compression quality issues systematically.
EXIF quality metadata. Some cameras and software record the JPEG quality setting in the image's metadata. You can check this by running the image through our EXIF checker — look for fields like "JPEG Quality" or "Compression" in the EXIF output. This tells you the quality of the last save, not necessarily the original capture quality.
Automated quality analysis. Our Quality Analyzer evaluates multiple metrics: resolution adequacy, noise levels, sharpness, and compression indicators. It provides an overall quality score and flags specific issues like excessive noise or low sharpness that often correlate with heavy compression.
ELA (Error Level Analysis). ELA reveals compression inconsistencies by re-saving the image at a known quality level and comparing the difference. Regions that were already heavily compressed show less change than regions compressed fewer times. This technique is primarily used for forensic tampering detection via our ELA Scanner, but it also reveals compression quality variation within a single image.
Visual inspection at zoom. The most direct method: zoom to 200-400% and examine smooth areas (sky, skin, solid backgrounds) for blocking grids, gradient areas for banding, and sharp edges for ringing halos. Our image quality checking guide walks through this process step by step.
JPEG Quality Settings: Practical Recommendations
The quality slider (usually 0-100) controls quantization aggressiveness. Higher numbers preserve more detail but produce larger files. Here's what to expect at different ranges:
Quality 95-100: Visually lossless for most images. File sizes are only 30-50% smaller than lossless PNG. Use for archival JPEG exports, print-ready images, and source files that won't be edited further. Artifacts are virtually undetectable without specialized analysis.
Quality 80-90: The sweet spot for web publishing. Artifacts are imperceptible at normal viewing distances. File sizes are 5-10× smaller than lossless. Most photography websites, e-commerce product images, and editorial photos use this range.
Quality 60-79: Artifacts begin appearing in smooth areas. Acceptable for thumbnails, social media previews, and images where small file size matters more than pixel-perfect quality. Not suitable for print or detailed viewing.
Quality 30-59: Obvious blocking, banding, and ringing. Suitable only for very small thumbnails or preview placeholders. Some platforms compress to this range to save bandwidth — which is why screenshotted social media images often look terrible.
Quality below 30: Extreme degradation. The image becomes a mosaic of 8×8 blocks with almost no detail. Sometimes used intentionally for artistic effect or as placeholder images during page loading.
💡 Did you know?
JPEG quality numbers aren't standardized across software. "Quality 80" in Photoshop, GIMP, ImageMagick, and your phone's camera app can produce noticeably different file sizes and artifact levels. The number controls a quantization table, and different implementations use different tables. The only reliable way to compare quality across tools is to measure the output, not trust the number — which is exactly what our Quality Analyzer does.
When JPEG Is the Wrong Choice
JPEG is designed for continuous-tone photographs — images with smooth color transitions, natural textures, and no sharp synthetic edges. It performs poorly on several common image types:
Screenshots and UI elements. Sharp edges between flat color regions produce severe ringing artifacts. Use PNG instead. Our Screenshot Scanner can identify images that are actually screenshots — and if yours is one, it probably shouldn't be a JPEG.
Text-heavy images. Ringing around letterforms makes text fuzzy and hard to read, especially at small sizes. PNG or SVG preserves text crispness perfectly.
Images with transparency. JPEG doesn't support alpha channels. If you need transparency, use PNG, WebP, or AVIF.
Source files for editing. Any image you plan to edit repeatedly should be stored in a lossless format. Applying adjustments to a JPEG and resaving compounds artifacts with every iteration.
Line art and diagrams. Simple graphics with hard edges and flat colors compress better with PNG and look dramatically worse as JPEG. A flowchart saved as JPEG at quality 80 will have visible ringing around every line and text element.
JPEG Artifacts in Forensic Analysis
Image forensics exploits compression artifacts as evidence. Since different JPEG saves leave characteristic patterns, analyzing these patterns reveals the editing history of an image.
Double compression detection. When a JPEG is resaved, the second quantization creates periodic patterns in DCT coefficients that aren't present in single-compressed images. Detecting double compression can reveal that an image has been edited, even if the edits are visually undetectable. This is one of the signals that our Authenticity Checker evaluates.
Compression-level inconsistency. If part of an image was pasted from a different source, the pasted region may have a different compression history. ELA visualizes these inconsistencies as brightness differences in the error map — manipulated regions glow differently from the rest of the image.
Ghost detection. JPEG ghosts appear when an image is saved at quality level Q1, edited, then resaved at quality level Q2. Re-encoding the final image at Q1 produces minimal error in unedited regions (they match Q1 compression patterns) but larger error in edited regions (which were only compressed at Q2). This technique can pinpoint tampered areas with high precision. Our JPEG Ghost Scanner automates this sweep across quality levels — read our full explanation of how JPEG ghost analysis exposes edits.
These forensic applications are why understanding JPEG compression matters beyond just visual quality. If you're investigating image authenticity, start with our Authenticity Checker for an automated assessment, then use the ELA Scanner for visual inspection of compression inconsistencies.
Modern Alternatives to JPEG
Several newer formats address JPEG's limitations while maintaining small file sizes:
WebP (Google, 2010) offers 25-35% smaller files than JPEG at equivalent quality, supports transparency, and has both lossy and lossless modes. Browser support is now universal. It uses a block-based approach similar to JPEG but with better prediction models and a modern entropy coder.
AVIF (Alliance for Open Media, 2019) achieves even better compression than WebP — roughly 50% smaller than JPEG at the same quality. It supports HDR, wide color gamut, transparency, and both lossy and lossless modes. Browser support has grown rapidly since 2023 and now covers Chrome, Firefox, Safari, and Edge.
HEIF/HEIC (Apple's default since iPhone 7) uses the HEVC video codec for still images. Quality is significantly better than JPEG at the same file size, but browser and software support outside the Apple ecosystem remains limited. If you encounter HEIC files, our EXIF checker can read their metadata even though not all browsers can display them natively.
Despite these alternatives, JPEG isn't going anywhere soon. Universal compatibility, decades of tooling, and the sheer volume of existing JPEG content ensure its continued dominance. Understanding its artifacts remains a practical skill for anyone working with digital images.
Frequently Asked Questions
What causes JPEG compression artifacts? JPEG divides images into 8×8 pixel blocks, transforms each to the frequency domain, and discards high-frequency data based on the quality setting. Lower quality discards more, producing blocking (grid patterns), banding (staircase gradients), ringing (halos around edges), and mosquito noise. These artifacts are permanent — discarded data cannot be recovered. Check artifact severity with our Quality Analyzer.
What is the difference between lossy and lossless compression? Lossy (JPEG, WebP lossy) permanently removes data for smaller files — the original can't be recovered. Lossless (PNG, TIFF) compresses reversibly — every pixel is preserved exactly. Lossy is 10-20× smaller but introduces artifacts. Choose lossy for web delivery, lossless for archival, editing, and forensic work.
How do I know if an image has been compressed too much? Look for visible 8×8 block grids in smooth areas, banding in gradients, and halos around sharp edges. Check the EXIF data for quality settings using our EXIF checker. For objective measurement, our Quality Analyzer evaluates sharpness, noise, and compression indicators and provides an overall quality score.
Does resaving a JPEG reduce quality further? Yes — every resave applies another round of lossy compression. Even saving at the same quality level introduces additional degradation because quantization errors compound and block grids may not realign. After 5-10 resaves, degradation is clearly visible. Always keep a lossless master copy and export to JPEG only as a final step.
What JPEG quality setting should I use? Quality 80-85 is the sweet spot for web: artifacts are invisible at normal viewing, files are 5-10× smaller than lossless. Use 95+ for print. Below 60, artifacts become obvious. Note that quality numbers aren't standardized across software — "quality 80" produces different results in different tools.