Rasp

File format

JPG

Thirty years old, technically outclassed, and still the only image format you can send to anyone with total confidence.

What is a JPG file?

A JPG is a photograph compressed with the JPEG standard, published in 1992. It achieves small files by permanently discarding detail the human eye is least likely to notice. It cannot store transparency, and it handles text and sharp edges badly — but essentially every device and program can open one.

The facts

Full nameJoint Photographic Experts Group
File extensions.jpg, .jpeg
MIME typeimage/jpeg
Introduced1992
Created byJoint Photographic Experts Group (ISO/IEC and ITU-T)
CompressionLossy
TransparencyNot supported
SpecificationITU-T T.81 — Digital compression and coding of continuous-tone still images

How JPEG compression works

The core insight of JPEG is that human vision is much better at seeing broad shapes and brightness than fine colour detail. So the encoder throws away the parts you are least likely to notice.

Concretely, it splits the image into 8×8 pixel blocks, converts each block into frequency components, and then discards the high-frequency ones according to a quality setting. Reconstruct the block from what remains and you get something very close to the original — close enough that at sensible settings the difference is invisible.

Two consequences follow, and they explain almost everything about JPG’s behaviour.

The loss is permanent. Once discarded, that detail is gone. Converting a JPG to a lossless format afterwards preserves what remains perfectly, but recovers nothing.

High-frequency detail suffers first. A hard edge — the boundary of a letter, a thin line in a diagram — is high-frequency detail. That is why JPG is superb for photographs and poor for screenshots and text.

Why it is still everywhere

JPEG is technically outclassed. On the fixed test image used across this site, the same source came out at 375 KB as JPG, 247 KB as WebP, and 109 KB as AVIF.

It survives on universality. Every operating system, every phone, every browser, every print shop, every photo frame, every upload form, every piece of software written since the mid-1990s can open a JPG. Nothing else on this list can claim that.

For anything you hand to another person, that is worth more than the bytes.

What JPG cannot do

  • Transparency. No alpha channel, ever. Transparent areas become a solid colour.
  • Lossless editing. Every save discards more. Edit in PNG and export to JPG at the end.
  • Sharp text. See above; this is structural, not a quality-setting problem.
  • More than 8 bits per channel. Fine for viewing, limiting for heavy editing.

Converting to and from JPG

Into JPG for compatibility: from HEIC, PNG, WebP or AVIF.

Out of JPG for size: to WebP or AVIF. Out of it for editing: to PNG, remembering that this preserves the damage rather than undoing it.

To make a JPG smaller without changing format, compress it and watch the measured trade-off.

Convert JPG files

From JPG

To JPG

Questions

What is the difference between JPG and JPEG?
Nothing. They are the same format with two spellings. The three-letter form exists because older versions of Windows required file extensions of at most three characters, and it stuck.
Is JPG lossy or lossless?
Lossy, always. Saving a JPG permanently discards image data, and the discarded detail cannot be recovered by any software. Saving the same image as a JPG repeatedly compounds the damage, which is why editing should be done in a lossless format.
Can a JPG have a transparent background?
No. JPG has no alpha channel and never has. Any tool that appears to give you a transparent JPG is either producing a PNG with the wrong extension or filling the transparency with a solid colour, usually white.
Why does my JPG look blurry or blocky?
Either it was saved at a low quality setting, or it has been re-saved many times. JPG works on 8×8 pixel blocks, and at aggressive settings the boundaries between those blocks become visible — the characteristic blocky look. Text and hard edges show it first.
What quality setting should I use?
Around 82 for general use, which is visually indistinguishable from the original at normal viewing sizes. 95 or above for printing or further editing. Below about 60, softening in flat areas and haloing around edges become noticeable.
Is JPG still worth using?
For compatibility, absolutely — it is the only image format you can send to a stranger with complete confidence. For a website you control, WebP and AVIF produce considerably smaller files at the same quality.
Why is JPG bad for screenshots?
Because its compression works by discarding high-frequency detail, and a hard black letter against white paper is exactly that. You get visible haloing around text. Screenshots belong in PNG.
Does JPG support layers or editing history?
No. A JPG is a single flattened image. Layers, adjustment history and non-destructive edits are features of editor formats such as PSD, not of an interchange format.

Sources