JPEG
JPEG (Joint Photographic Experts Group) is the most popular lossy image format, which greatly reduces file size at the cost of a small, usually imperceptible loss of image quality. The name comes from the group of experts that developed the standard. Thanks to strong compression and universal support in browsers and cameras, JPEG has remained the default photo format on the web for years. Files carry the extension .jpg or .jpeg.
How JPEG compression works
JPEG uses lossy compression, which permanently discards part of the image information, exploiting the limits of human vision. In simple terms:
- the image is split into blocks of pixels and transformed mathematically;
- the algorithm drops the details the eye perceives least, especially subtle colour differences;
- the higher the compression level, the smaller the file, but also the more visible the artefacts.
This method excels with photographs featuring smooth colour transitions and does worse with graphics that have sharp edges and text, where lossless PNG is better. Unlike PNG, JPEG does not support transparency.
Practical applications
In website optimisation, JPEG is the go-to format for product photos, backgrounds and galleries, where a low file weight and fast loading are the priority. Newer formats such as WebP and AVIF offer better compression at comparable quality, so they increasingly replace JPEG on modern sites. Choosing the right format and size for images directly affects Core Web Vitals scores and site speed. When optimising JPEG photos, it is worth picking a compression level that balances a small file size with acceptable quality — too aggressive compression reveals visible artefacts around edges and in smooth areas. A good practice is also to serve images sized to match where they appear and to use lazy loading, which defers fetching graphics outside the visible area. Despite the growing popularity of newer formats, JPEG remains a safe choice where maximum compatibility is crucial, because virtually every device and graphics program supports it.
Powiązane pojęcia
Najczęstsze pytania
When should you use JPEG versus PNG?
JPEG works well for photographs and images with smooth colour transitions, where a small file size matters. PNG is better for graphics with sharp edges, text and logos, and where transparency is needed, which JPEG does not support.
Does JPEG support transparency?
No. JPEG does not store an alpha channel, so it does not support a transparent background. If the graphic needs transparent areas, use PNG, WebP or AVIF instead.
