Accepting selected projects for Q2 2024 Check availability →
SERVER 02SYSTEM ONLINELAST SYNC: 03:17:44RSS 2.0 — ONLINE
HALF ASSEDTECHNICAL NOTES_
EST. 1999ISSUE 04.2BEST VIEWED AT 1024 × 768
TECHNICAL NOTES / TECHNICAL NOTES / WEB GRAPHICS / RECORD 5a3616
[WEB GRAPHICS]NOTE

Choosing JPEG, GIF or PNG for web images

POSTED: 24.08.2000AUTHOR: ADMIN2 MIN READCOMMENTS: 0

Keep an editable master and produce separate files for the website. The best export depends on the image: a photograph, a small diagram and a transparent button place different demands on compression and colour.

Use JPEG for continuous-tone pictures

Photographs usually compress well as JPEG. Resize to the required pixel dimensions before choosing the quality setting, and inspect faces, edges and areas of fine texture. Repeatedly opening and saving a JPEG introduces further loss, so regenerate exports from the master. Sharp lettering and flat-colour diagrams often develop visible artefacts around their edges.

Use a palette deliberately

GIF supports a palette of up to 256 colours and a transparent palette entry. It suits small flat-colour artwork when that palette is sufficient. Reduce unnecessary colours and inspect the result rather than assuming the smallest export is acceptable. Dithering can imitate extra colours but adds visible texture, and can make large areas harder to compress.

Test PNG in the browsers you support

PNG provides lossless compression, including true-colour images and alpha transparency. Its format capabilities do not guarantee identical rendering in the browsers currently in use. Test transparency against the actual page background in each supported browser. Where that fails, export artwork against a fixed background or use a suitable GIF version; keep the original so another export remains possible.

PAGE CHECK

Set image dimensions in the HTML so space can be reserved during loading, provide useful alternative text and compare total page weight over the connection speed your visitors actually use.

References

W3C: JPEG JFIF

W3C: PNG 1.0 specification, October 1996

W3C: HTML 4.01 images