Format
What Is JPEG? A Complete Guide to the JPG Image Format
JPEG is the world's most widely used photo format — lossy compression that makes photographs small enough to share without perceptible quality loss at typical settings.
What is JPEG?
JPEG (Joint Photographic Experts Group) is an image compression standard published in 1992. It was designed specifically for photographic images — complex scenes with smooth tonal gradations, natural textures, and millions of colors. Within a few years of its release, JPEG had become the dominant format for digital photography and remains so today.
The format uses lossy compression, which means it permanently discards some image data during encoding. The degree of loss is adjustable via a quality setting. At typical web quality settings (80–90), most viewers cannot detect any difference from the uncompressed original. At low quality settings (below 50), blocky compression artifacts become visible, especially on high-contrast edges.
JPEG does not support transparency, animation, or lossless compression. For images that need any of these features, a different format is required.
How JPEG compression works
JPEG compression works in several stages:
- Color space conversion: The image is converted from RGB to YCbCr, separating luminance (brightness) from chrominance (color). The human eye is less sensitive to color detail than brightness detail, so JPEG can discard color data more aggressively.
- Chroma subsampling: Color (Cb and Cr) channels are often reduced to half resolution in one or both dimensions, cutting color data by 50–75% with minimal visible impact.
- Block splitting: The image is divided into 8×8 pixel blocks.
- DCT (Discrete Cosine Transform): Each block is transformed into frequency components. High-frequency detail (sharp edges) can be represented at lower precision than low-frequency content (smooth gradients).
- Quantization: Frequency components are divided by a quantization table. Higher quality = finer quantization = more data retained. This is where the quality setting has its effect.
- Entropy coding: The quantized values are compressed with Huffman coding (losslessly), producing the final file.
This is why JPEG artifacts look like 8×8 blocky patterns — they come from the block-based DCT step. The "ringing" or "mosquito noise" around sharp edges comes from the high-frequency component of those edges being discarded by quantization.
Color depth and specifications
- Color depth: 24-bit RGB (8 bits per channel: red, green, blue)
- No alpha channel — transparency is not supported
- No animation — static images only
- No lossless mode — even at quality 100, JPEG applies mild quantization
- Baseline JPEG: Standard top-to-bottom decoding, universal support
- Progressive JPEG: Multiple scan passes — blurry preview loads first, sharpens progressively. Slightly better compression than baseline; slower on some hardware.
- Max dimensions: 65,535 × 65,535 pixels
Browser and OS support
JPEG has universal support across every browser, operating system, device, email client, and image editing application. It is the lowest common denominator of digital photography — if a device can display images, it supports JPEG.
When to use JPEG
- Photographs and complex natural imagery: JPEG was built for this. Smooth gradients, natural textures, and varied colors compress well.
- Print workflows: Many print systems require JPEG or TIFF. Use quality 90–95 for print-bound images.
- Maximum compatibility: If you're sending images to a system you don't control — an older CMS, email client, or printer — JPEG is the safest choice.
Do not use JPEG for:
- Logos, icons, or graphics with flat colors and sharp edges — artifacts are visible and PNG or SVG will be smaller
- Screenshots — text and UI elements get heavily artifacted
- Images that need transparency
- Images you'll edit and re-export repeatedly — use PNG or TIFF as working format, export to JPEG only at the final step
JPEG vs other formats
| Format | Compression | Alpha | Animation | Relative size (photo) | Best use |
|---|---|---|---|---|---|
| JPEG | Lossy | No | No | 100% | Photos, print, legacy compat |
| PNG | Lossless | Yes | No | 300–500% | Logos, UI, transparency |
| WebP | Lossy + Lossless | Yes | Yes | ~65% | Web delivery default |
| AVIF | Lossy + Lossless | Yes | Yes | ~50% | Best quality/size ratio |
Frequently asked questions
Does saving a JPEG multiple times degrade quality?
Yes. Every time you open a JPEG and save it again with lossy compression, the codec re-runs its lossy algorithm on already-compressed data. Artifacts accumulate and fine detail is permanently lost with each generation. Always edit from the original file and export once — never repeatedly resave the same JPEG.
Does JPEG support transparency?
No. JPEG has no alpha channel. Any transparent areas in a source image get filled with a solid color (usually white or black) when saved as JPEG. For images that need transparency, use PNG, WebP, or AVIF instead.
What's the difference between JPG and JPEG?
They are identical formats. JPEG is the full name (Joint Photographic Experts Group). JPG is the three-character extension used by older Windows systems that required short file extensions. Both .jpg and .jpeg files are the same format.
What quality setting should I use for JPEG?
For web delivery, 80–85 is a good default — images look sharp and file sizes stay reasonable. Use 90–95 for print or large-format images where fine detail matters. Anything above 95 produces large files with almost no visible improvement. Below 70, compression artifacts start to become visible on most photos.
Should I use JPEG or WebP?
WebP for web delivery. WebP lossy is typically 25–35% smaller than JPEG at equivalent visual quality, and it adds alpha transparency and animation support. The only reason to choose JPEG over WebP is when you need maximum compatibility with legacy systems, print workflows, or email clients that do not support WebP.
