Picovert

JPEG Compression Explained: Quality Settings, DCT, and When to Use JPEG

By Picovert Team2026-04-146 min read

JPEG is the world's most widely used image format — nearly every photo on the web, every image shared on social media, and every picture stored on a phone is either a JPEG or was once a JPEG. Yet most people have no idea how JPEG compression actually works, what that quality slider really controls, or when JPEG is the right choice versus PNG or WebP. This guide explains all of it in plain language.

How JPEG compression works: the DCT explained

JPEG uses a technique called the Discrete Cosine Transform (DCT) to compress image data. The process works in a few stages. First, the image is divided into small 8×8 pixel blocks. Then each block is analyzed to find patterns in brightness and color — specifically, how quickly values change across the block (called "frequency").

The DCT converts each block into a set of frequency components. Low frequencies represent gradual changes, like a smooth sky gradient. High frequencies represent sharp edges and fine details. The key insight is that human vision is much more sensitive to low-frequency information than high-frequency detail. JPEG exploits this: it keeps low-frequency components at full precision and discards or rounds high-frequency components aggressively. The more aggressive the rounding, the smaller the file — and the more detail is lost.

After the DCT step, a second compression stage (Huffman coding) squeezes the data further without any additional quality loss. This is the lossless part of JPEG encoding.

What the quality setting actually controls

Most JPEG encoders expose a quality setting from 0 to 100. This number controls a quantization table — essentially, how aggressively the high-frequency DCT components are rounded before encoding. A quality of 100 means almost no rounding: the file stays large but looks nearly identical to the original. A quality of 1 rounds so aggressively that colors smear and the image looks like a mosaic of colored squares.

The relationship between quality and file size is not linear. Dropping from 95 to 85 can cut file size in half with almost no visible change. Dropping from 85 to 60 cuts size further but starts to introduce visible compression artifacts around edges and in smooth gradients.

Quality level comparison: 60, 75, 85, 95

Here is what to expect from common quality settings when compressing a typical photograph:

QualityTypical file sizeVisual qualityBest use case
95Very large (~80% of original)Excellent, near-lossless appearanceArchiving, source files for re-editing
85Large (~40% of original)Very good, artifacts invisible at normal viewing sizeHigh-quality web publishing, portfolio sites
75Medium (~20% of original)Good, minor artifacts visible on close inspectionGeneral web use, blog posts, social media
60Small (~10% of original)Acceptable, noticeable artifacts in smooth areasThumbnails, previews, bandwidth-constrained delivery

For most web images, a quality between 75 and 85 is the sweet spot. You get a file that is dramatically smaller than the original while remaining visually sharp at screen resolutions.

Understanding JPEG artifacts

JPEG compression introduces specific types of visual degradation called artifacts. The most common is "blocking" — you can see the outlines of those 8×8 pixel blocks, especially in smooth gradients like skies or skin tones. Another artifact is "ringing," which creates faint halos around sharp edges. Both become more visible as quality drops below 70.

Artifacts are also cumulative. Every time you open a JPEG and save it again at any quality below 100, you add a new layer of artifacts on top of the existing ones. If you need to edit an image repeatedly, work in a lossless format (PNG or TIFF) and only export to JPEG as the final step.

JPEG vs PNG: which to use

The choice between JPEG and PNG comes down to the content of the image:

Use JPEG for photographs, complex scenes with millions of colors, and any image where small file size matters more than pixel-perfect accuracy. Photos of people, landscapes, food, and products are all ideal candidates for JPEG.

Use PNG for logos, screenshots, illustrations, diagrams, and any image that contains text, sharp geometric shapes, or transparency. PNG is lossless, so it preserves every pixel exactly — but files are much larger for photographic content.

JPEG vs WebP: is it time to switch?

WebP typically produces files 25–35% smaller than JPEG at the same visual quality. It also supports transparency (which JPEG cannot). Browser support for WebP is now essentially universal, so for new web projects it is worth defaulting to WebP.

That said, JPEG remains better supported in email clients, older editing software, and some printing workflows. If you are unsure about downstream compatibility, JPEG is the safer choice.

You can convert between formats — including compressing an existing JPEG to a smaller file or converting a JPEG to WebP — with our free online tool.

Compress your JPEG online

Convert JPEG to WebP or PNG

Tips for getting the best JPEG compression results

Start with the highest quality source you have. Compressing an already-compressed JPEG compounds the artifacts. If you shot on a smartphone, use the original file rather than a screenshot or a shared copy.

Resize before you compress. A 4000×3000 pixel image compressed to quality 85 is still a much larger file than a 1200×900 version at quality 85. Reducing dimensions is often more effective than lowering the quality setting.

Use the right tool. Many online compressors allow you to preview the compressed result before downloading, so you can find the quality level that looks good while keeping the file as small as possible.