A newsletter header with a gradient background
The gradient was the background of a newsletter header we made. Its headings stayed HTML text, so only the background changed between versions.
16-colour PNG background

CSS gradient

A gradient with a known starting point
The source was a 1200 × 360 horizontal gradient from RGB (24, 40, 64) to (76, 116, 168), interpolated in sRGB values. We generated it directly with 16-bit channel samples, then made an 8-bit truecolour PNG without dithering. That version contained 225 distinct colours.
An indexed PNG can hold up to 256 colours, enough to keep this 8-bit image exactly. A 256-colour export kept all 225 colours and every decoded RGB byte, but at 3,575 bytes it was larger than the 2,067-byte truecolour file.
We then deliberately chose a much lower limit of 32 colours to make the loss of intermediate colours easy to see. ImageMagick picked 16 for this input. Both reduced-palette versions used that same palette, once without dithering and once with Floyd–Steinberg dithering.
The tools were ImageMagick 7.1.1-47 Q16-HDRI, libjpeg-turbo 3.2.0 and libwebp 1.6.0. Browser comparisons on 2026-11-16 used Google Chrome 157.0.8103.78 on macOS 27.0.1, forced to sRGB at a device pixel ratio of 1.
| Version, all 1200 × 360 | Bytes |
|---|---|
| 16-bit truecolour PNG | 4,250 |
| 8-bit truecolour PNG | 2,067 |
| Indexed PNG, all 225 colours kept | 3,575 |
| 16 colours, no dithering, 8-bit indices | 2,480 |
| 16 colours, dithering, 8-bit indices | 78,372 |
| 16 colours, no dithering, 4-bit indices | 1,254 |
| 16 colours, dithering, 4-bit indices | 78,794 |
| JPEG, quality 80, 4:4:4 | 8,019 |
| Lossy WebP, quality 80, method 4 | 1,404 |
| 8-bit PNG with slight noise | 208,038 |
| Noisy source as JPEG, quality 80 | 8,470 |
| Noisy source as WebP, quality 80 | 1,422 |
PNG exports used compression level 9 with metadata removed. Each lossy file was encoded from its named source, not from another JPEG or WebP.
A smaller palette made broad bands
With only 16 colours available, the version without dithering gave long stretches of the image one colour before switching to the next, and the boundaries were clear at normal size. PNG kept the pixels it was given, bands included.
16-bit PNG · 4,250 bytes

8-bit PNG · 2,067 bytes

16 colours, no dithering · 1,254 bytes

16 colours, dithering · 78,794 bytes

Dithering arranged neighbouring palette colours in a pattern; it did not add colours to the palette. The enlarged detail shows the pattern replacing the flat boundary.
16 colours, no dithering

16 colours, dithering

The dithered file with 4-bit indices was 62.8 times the size of its undithered counterpart. Packing indices into 4 bits cut the plain file from 2,480 to 1,254 bytes but made the dithered file slightly larger. For each treatment, 4-bit and 8-bit indices decoded to identical pixels.
On this quiet background the dither pattern was visible in its own right. The PNG specification describes the trade-off: “For photograph-like images, dithering is recommended to avoid ugly contours in what should be smooth gradients; however, dithering introduces graininess that can be objectionable.”
JPEG and WebP added steps of their own
The clean 8-bit PNG changed by fine steps across the ramp. JPEG at quality 80, even with 4:4:4 sampling, introduced wider flat areas and more abrupt boundaries, and it was 3.9 times as large: 8,019 bytes against 2,067.
WebP was smaller at 1,404 bytes, but it also showed steps. The enlarged crops below come from the decoded files.
8-bit PNG · 2,067 bytes

JPEG · 8,019 bytes

WebP · 1,404 bytes

For this smooth synthetic background, JPEG was both larger and less smooth than the full-colour PNG, and WebP saved bytes at the cost of visible steps. Compare a truecolour PNG before choosing either.
Noise made the PNG about 100 times larger
We made another 8-bit source with fixed random noise: at each pixel, an adjustment of −1, 0 or +1 was applied to all three channels.
Stored exactly as PNG, those noisy pixels cost 208,038 bytes, about 100 times the clean version's 2,067. The JPEG files cost 8,019 and 8,470 bytes without and with noise, and the WebP files 1,404 and 1,422.
8-bit PNG · 2,067 bytes

JPEG · 8,019 bytes

WebP · 1,404 bytes

PNG with slight noise · 208,038 bytes

JPEG with slight noise · 8,470 bytes

WebP with slight noise · 1,422 bytes

This much noise did not remove the steps from the final JPEG and WebP files. If you try noise as a fix, check the exported file, not the editor preview.
A CSS background needed no image request
The browser could draw the newsletter background itself. We tested:
background: linear-gradient(to right in srgb, #182840, #4c74a8);The declaration is 64 characters, and the page does not request a background image for that panel. in srgb tells the browser to mix the two colours in the same colour space as our image gradient.
Chrome accepted the syntax, and the CSS panel avoided the coarse palette bands in our screenshot. CSS Images 4 lets browsers dither gradient colours slightly to make them smoother. Keep a design background in CSS when that suits the page, and check the real rendering at the sizes people use.
Check the colours before reducing them
Keep the source and compare each export at 100% before enlarging the same region. Look for long flat areas, abrupt boundaries and fine patterns.
We verified this command for the dimensions, reported depth and number of colours:
magick identify -format '%f %wx%h depth=%z colours=%k\n' gradient.pngStart with %k. An 8-bit image with no more than 256 colours fits completely in an indexed PNG, so try an export that keeps them all and compare its size with truecolour PNG; our lossless indexed version was larger. With more colours, as in a wider-range gradient, a two-dimensional gradient or a photograph, a 256-entry palette means reducing colours.
For a controlled dithering comparison, make the palette once and remap the same source twice:
magick gradient.png -quantize sRGB +dither -colors 32 \
-unique-colors -depth 8 palette.png
magick gradient.png +dither -remap palette.png -strip \
-define png:compression-level=9 PNG8:no-dither.png
magick gradient.png -dither FloydSteinberg -remap palette.png -strip \
-define png:compression-level=9 PNG8:dither.pngThese exports use 8-bit indices. We also verified 4-bit indices with -define png:color-type=3 -define png:bit-depth=4: packing saved space in the plain file but did not bring back its missing colours, while full colour cost only another 813 bytes and avoided the bands.
If you compress the final PNG or use any other tool such as Bitinz, compare the same region at 100% afterwards. For PNG sizes in general, see how to reduce PNG file size, and for the wider trade-off, lossy vs lossless compression.
What we did not test
Physical displays and HDR were outside this test, and we used one Chrome version. We did not test stronger noise, photographs or printed output.
FAQ
- Should I save a gradient background as JPEG?
- Try full-colour PNG or a CSS gradient first for a smooth synthetic background. Our JPEG was almost four times larger than the PNG and introduced visible steps. If you use JPEG anyway, compare the final export with the original gradient at the actual display size.
- Why can a PNG show bands if PNG is lossless?
- Check whether the export reduced the colours or channel precision before writing the PNG. Lossless storage keeps the resulting pixels, bands included. Export a truecolour copy from the original and inspect the same region.
- Should I add noise to hide bands?
- Try it on a copy and inspect the final export. Our slightly noisy PNG became about 100 times larger, and the JPEG and WebP versions still had steps. For a page background, test CSS before adding texture to an image.
- Can converting a banded file to 16-bit fix it?
- No. Go back to the high-precision source or recreate the gradient. A larger storage depth cannot rebuild intermediate values that were already removed, so keep that source while you choose the export.