PNG vs JPEG File Size Threshold for Web
Choosing between PNG and JPEG formats directly impacts page load speed, bandwidth usage, and visual fidelity. While PNG offers lossless compression ideal for graphics with text and sharp lines, JPEG provides lossy compression suited for complex imagery. This article outlines the specific file size thresholds and visual criteria that justify replacing a static PNG graphic with a web JPEG to optimize website performance.
The 100 KB File Size Benchmark
For general web performance, a file size threshold of 100 KB is the standard benchmark where converting a PNG to a JPEG becomes necessary. When an uncompressed or high-color PNG exceeds 100 KB to 150 KB, switching to a well-compressed JPEG (typically between 75% and 85% quality) often reduces the file size by 50% to 80% without perceptible visual loss.
If converting a PNG to a JPEG saves less than 10 KB to 20 KB, the switch is rarely worth the loss in compression fidelity. However, if the savings exceed 30% of the total asset weight—or roughly 40 KB to 50 KB on a single asset—converting to JPEG is justified to improve Core Web Vitals, specifically Largest Contentful Paint (LCP).
Image Characteristics That Dictate the Switch
File size alone does not dictate format selection; the visual structure of the graphic determines whether JPEG compression is appropriate:
- Photographic Content and Continuous Tones: If a static graphic contains photographs, gradients, complex textures, or photorealistic elements, saving it as a PNG-24 quickly inflates the size past 200 KB or even several megabytes. Replacing these files with a JPEG immediately yields massive size reductions with minimal artifacting.
- Flat Graphics and Vector-Style Imagery: Logos, screenshots of user interfaces, typography, and illustrations with limited color palettes compress efficiently in PNG-8 or PNG-24 formats. Converting these to JPEG often results in visible noise and edge blur around text and high-contrast boundaries, even if the file size drops slightly.
When to Retain PNG Regardless of File Size
There are two primary conditions where a PNG should not be converted to a JPEG, regardless of the size threshold:
- Alpha Transparency: JPEG does not support transparency. If a graphic requires a transparent or semi-transparent background to sit over varying design elements, it must remain a PNG (or be converted to a modern format like WebP).
- Fine Line Work and UI Text: When an image contains critical small text or fine diagrams, JPEG's discrete cosine transform (DCT) compression introduces noticeable artifacts, making text blurry and difficult to read. In these cases, optimizing the PNG using tools like palette quantization (PNG-8) is preferable to switching to JPEG.