Skip to main content
images

PNG vs JPG vs WebP: choose the format from the image, not habit

Use JPEG for photographic detail, PNG for lossless pixels or alpha, and WebP when your delivery pipeline can negotiate it well.

Thien Nguyen
By Thien Nguyen
Updated April 6, 2026 · 1 min read

There is no universally smallest image format. JPEG usually wins for photographs, PNG for sharp UI art and transparency, and WebP offers lossy and lossless modes that can reduce transfer size. Compare the actual image at the dimensions users receive.

ImageFirst choiceReason
Product photographJPEG or lossy WebPSmooth colour tolerates lossy compression
Logo with transparencyPNG or lossless WebPSharp edges and alpha matter
Screenshot with textPNG or lossless WebPJPEG artefacts make type look dirty
Animated assetWebP or videoGIF is usually wasteful

Resize before obsessing over format

Shipping a 4000px original into a 400px card dominates every codec decision. Generate responsive sizes, set explicit width and height, and let the browser choose an appropriate source.

<img src="card-800.webp" width="800" height="450" alt="Dashboard latency chart" />

A 30 KB saving is not helpful if the image is so compressed that a user cannot read the screenshot or trust the product photo.

Test at 1× and high-density displays. For a photo, inspect faces and gradients; for a screenshot, inspect text and hairline rules. Keep the source asset separately from delivery derivatives so a future design can be regenerated rather than recompressed from a damaged JPEG.

References

Primary documentation and specifications checked when this article was last updated.

imagesperformanceweb-development

Related articles

All articles