Two JPEG files can look almost identical on your phone and still contain meaningfully different image information.
One may preserve fine eyelashes, subtle fabric and smooth sky. Another may replace those distinctions with blocks, ringing and colour simplification that are invisible until you crop, edit or inspect closely.
JPEG does not store every pixel independently. It transforms local image structure, then deliberately represents some components more coarsely than others to reduce file size.
This article continues the canonical How Photography Works | Every Photograph Leaves Something Out knowledge map. Versions owns the identity and provenance problem. JPEG Compression owns the mechanism by which one version can become informationally weaker while remaining recognisably the same picture.
Quick Read
JPEG compression usually converts image data into a luminance/chrominance representation, may reduce colour resolution, divides the image into small blocks, transforms local pixel variation into spatial-frequency coefficients and quantises those coefficients so less visually important information can be stored more coarsely or discarded. The remaining values are encoded efficiently. Higher compression increases the chance of block boundaries, ringing, mosquito noise, banding and texture loss. Re-saving an already compressed JPEG can introduce additional loss because the new encoding operates on a signal that has already been quantised.
pixels → colour transform → block transform → quantisation → entropy coding → JPEG file
JPEG Is Lossy by Design
Lossless compression tries to reduce file size while allowing the original data to be reconstructed exactly. JPEG’s common photographic mode accepts a different bargain: discard or coarsen some image information in exchange for much smaller files.
The success of the format comes from choosing losses that are often difficult to notice under ordinary viewing conditions.
The Image Is Rewritten Into Another Representation
JPEG compression does not usually begin by asking which individual pixels can be deleted. Instead it converts local image blocks into a representation describing broad averages and spatial changes.
This is important because smooth areas and fine textures behave differently in that transformed representation. A blue sky contains mostly low-frequency variation. Hair, grass and text contain stronger high-frequency structure.
Eight-by-Eight Blocks Are Part of the Classical Mechanism
Baseline JPEG typically processes image components in 8 × 8 sample blocks. Each block is transformed using a discrete cosine transform, producing one coefficient related to the block’s average and others describing increasingly fine spatial variation.
The block boundaries are not normally visible at high quality. They become visible when strong quantisation makes neighbouring blocks reconstruct differently.
The DCT Separates Broad Structure From Fine Structure
The discrete cosine transform represents each block as a weighted combination of spatial patterns. Low-frequency coefficients describe slow changes across the block. High-frequency coefficients describe rapid alternation and fine detail.
This gives the encoder a useful opportunity: high-frequency components that contribute less to perceived quality in some contexts can be represented more coarsely than the block average and broad tonal structure.
Quantisation Is Where Irreversible Loss Happens
After transformation, coefficients are divided by quantisation values and rounded. Several different original values can therefore become the same stored value. Once that rounding occurs, the exact original coefficient cannot be recovered from the JPEG alone.
This is the central lossy step. The encoder reduces precision strategically rather than preserving every transformed value exactly.
“Quality 80” Is Not a Universal Scientific Scale
Different applications map quality sliders to different quantisation tables and encoding choices. A JPEG saved at “80” in one program may not match “80” in another.
The number is a user-interface convention. The underlying compression settings and source content determine the actual result.
Colour Can Be Stored at Lower Spatial Resolution
Human vision is generally more sensitive to fine luminance structure than to fine colour differences. JPEG often exploits this by chroma subsampling: colour information is stored at lower spatial resolution than brightness information.
For photographs this can be remarkably efficient. For coloured text, graphics and high-contrast edges, reduced chroma resolution can produce visible colour bleeding or softness.
A Photograph and a Screenshot Stress JPEG Differently
Natural photographs contain gradients, texture and optical blur that JPEG handles well. Screenshots often contain razor-sharp text, flat colours and one-pixel edges. Compression artefacts become more obvious because the content violates the assumptions that make photographic loss visually forgiving.
This is why a format suitable for a portrait may be poor for interface diagrams or typography.
Blocking Appears When Neighbouring Blocks Stop Agreeing
Strong compression can make the 8 × 8 processing grid visible as square regions with slightly different reconstructed tone or colour. Smooth skies and skin are common places to notice this because the underlying scene provides few real boundaries to hide the artificial ones.
The blocks are not objects in the scene. They are footprints of the encoding architecture.
Ringing Appears Near Strong Edges
When high-frequency information is strongly quantised, reconstructed edges can develop faint oscillations: bright or dark bands near a sharp boundary. This is often called ringing.
Sharpening can make these artefacts more visible because it strengthens transitions that the compression pipeline already distorted.
Mosquito Noise Lives Around Fine Detail
Fine text, hair, branches and graphic edges can acquire shimmering or crawling-looking artefacts around them. In still images these appear as small noisy patterns clustered around strong high-frequency structure.
The name describes appearance, not a separate insect-like encoding stage. It is another consequence of coarse frequency representation around complex edges.
Smooth Gradients Can Become Less Smooth
Heavy compression, low bit depth or prior processing can turn a smooth sky into visible steps or patches. JPEG may add block and quantisation structure to a gradient that was already close to the representation limit.
Article 36, Bit Depth and Banding, owns the quantisation-level problem more broadly.
Fine Texture Is Expensive to Compress
Grass, foliage, hair, fabric and sand contain many small changes. Preserving them requires more high-frequency information. Strong compression simplifies those structures, producing smeared or painterly regions.
A JPEG of a smooth studio background can therefore be much smaller at similar quality than a photograph filled with tree branches and fine grass.
Noise Is Also Expensive
Random noise creates high-frequency variation that the encoder must either preserve with more data or suppress through quantisation. A noisy photograph can produce a larger file at a given quality setting than a smooth denoised version.
This connects to Noise. Denoising before export can improve compression efficiency, but excessive denoising may erase real texture along with uncertainty.
Repeated JPEG Saves Are Not Free
Open a JPEG, edit it and save again as JPEG. The new encoder receives reconstructed pixels that already contain the first generation’s quantisation errors. It transforms and quantises them again.
The damage does not necessarily explode after one high-quality save, but repeated generations can accumulate artefacts and texture loss. A strong workflow returns to a high-quality master whenever possible.
Cropping on Block Boundaries Does Not Magically Make JPEG Lossless
Some specialised JPEG operations can rotate or crop aligned blocks without fully decompressing and recompressing the image. But ordinary editing applications often decode to pixels and save a new JPEG generation.
The actual workflow matters more than the filename extension alone.
Metadata Can Change Without Pixel Data Changing
A JPEG file contains more than compressed image coefficients. It may also contain EXIF, colour profiles, thumbnails and other metadata. Software can sometimes alter metadata without recompressing the main image data.
This is why Metadata and compression must remain separate concepts.
JPEG Can Preserve a Picture While Weakening Evidence
A compressed copy can preserve subject identity, composition and broad colour beautifully while losing tiny text, texture and weak contrast differences. For social viewing, that may be an excellent trade. For scientific, legal or archival inspection, it may be unacceptable.
The correct question is not “Does it still look like the photograph?” but “Does it still preserve the information needed for this job?”
Compression Can Hide Manipulation Clues—and Create False Ones
Strong JPEG artefacts can obscure fine boundaries used in image-forensics analysis. Recompression can also create block patterns and ringing that inexperienced viewers may mistake for evidence of editing.
Compression artefacts alone should not be treated as proof that an image is authentic or manipulated. Provenance requires a wider evidence chain.
Social Platforms Often Recompress Uploads
A photographer may upload a high-quality JPEG, but the platform can resize, strip metadata, convert colour space and compress again for bandwidth and delivery. The image seen by the final viewer is another derivative.
This is a direct bridge back to Versions: the same apparent photograph may exist as several different data objects.
JPEG and RAW Serve Different Jobs
A RAW file preserves relatively unrendered sensor measurements and greater editing latitude. JPEG stores a rendered, compressed image designed for portability and immediate viewing.
Neither is universally “better.” The RAW file is stronger for extensive interpretation and archival processing; the JPEG is efficient for delivery. Problems arise when the derivative is mistaken for an untouched measurement object.
The JPEG Compression Audit
- Source: RAW render, TIFF, PNG, original JPEG or already compressed derivative?
- Dimensions: was the image resized before compression?
- Quality setting: how aggressive was quantisation?
- Chroma: was colour subsampled?
- Texture: does the image contain grass, hair, text or noise that is expensive to encode?
- Artefacts: blocking, ringing, mosquito noise or smearing?
- Generation: how many times has the image likely been recompressed?
- Platform: did a website or messaging app create another derivative?
- Colour profile: was profile information preserved?
- Purpose: casual viewing, publication, archive, measurement or forensic inspection?
Photography Laboratory 1: Quality Ladder
Export one master photograph at several JPEG quality settings. Compare file size, smooth skies, hair, text, fabric and foliage. Identify which details fail first.
Photography Laboratory 2: Generation Loss
Save one copy from the master, then repeatedly open and re-save the derivative at the same moderate quality. Compare later generations with a fresh export from the master.
Photography Laboratory 3: Screenshot Versus Export
Compare a direct JPEG export with a screenshot of the displayed image. Inspect dimensions, metadata, colour and fine detail. Ask whether “looks the same” means “is the same data object.”
For Primary Readers
Make one picture very compressed and one high quality. Zoom into hair or leaves. Ask what disappeared even though you can still recognise the subject.
For Secondary Readers
Connect JPEG to representation and approximation. Explain why a smaller file can preserve broad appearance while storing fine differences more coarsely.
For Advanced Readers
Analyse baseline JPEG through colour transformation, chroma subsampling, blockwise DCT, coefficient quantisation, zig-zag ordering and entropy coding. Examine rate–distortion trade-offs, blocking, ringing, quantisation noise and cumulative recompression under changing block alignment.
Common Misconceptions
- “JPEG deletes random pixels.” It transforms local image structure and quantises transform coefficients.
- “Quality 80 means 80% of the original information.” Quality sliders are implementation-specific controls, not a universal percentage.
- “If two JPEGs look the same, they contain the same information.” Fine detail and metadata can differ substantially.
- “Opening a JPEG damages it.” Viewing does not; decoding and re-saving with lossy compression can.
- “JPEG artefacts prove manipulation.” Compression itself can create suspicious-looking structures.
Frequently Asked Questions
Why is JPEG so efficient for photographs?
Natural images contain spatial and perceptual redundancies that transform coding, quantisation and chroma subsampling can exploit effectively.
Does JPEG always use 8 × 8 blocks?
Classical baseline JPEG uses 8 × 8 transform blocks for each component, although surrounding encoding and subsampling structure can vary.
Should I archive important originals as JPEG?
A high-quality JPEG can be visually excellent, but if maximum editing latitude or measurement fidelity matters, preserve the best available original or a suitable lossless/high-bit-depth master as well.
Final Thought: Recognisable Is Not Identical
JPEG became one of photography’s great delivery formats because it learned how much information could often be discarded before a human viewer cared.
The image can survive as a picture while changing as an evidence object.
HOW PHOTOGRAPHY WORKS · SUPPORTING SERIES · 34 OF 40
Return to Every Photograph Leaves Something Out. Previous: Resizing. Next: Colour Spaces and Gamut. Return to the How X Works Hub.