liveBook · Manning

JPEG

As explained in Web Design Playground, Second Edition

JPEG is an image file format that commonly stores photographic imagery using lossy compression.

JPEG is a common image format for photographs and complex images. Its lossy compression makes files smaller, trading some image quality for faster downloads and less bandwidth use. section 6.13 section 6.17

Choose JPEG when the picture matters more than perfectly crisp, limited-color edges:

  • Start JPEG compression around 60% to 75%, then inspect the result; more compression usually harms quality, while less compression produces larger files. section 6.13
  • Resize images before uploading them. A browser can shrink an oversized file, but making it download a huge image first wastes bandwidth. section 6.13
  • Prefer JPEG for photos and complex imagery; use PNG instead for illustrations, logos, icons, or transparency. section 6.17

A practical photo gallery

Prepare each photo as a regular image and a thumbnail. One workable gallery uses 300 × 200 pixel thumbnails and 2048 × 1365 full-size JPEGs, keeping the larger files within a sensible size. section 15.2

<img src="file" alt="description" title="tooltip">

Place a JPEG on a web page by using its filename as the img element’s source and providing descriptive alternative text. section 6.17

How Web Design Playground, Second Edition covers it

How deep it goes
Explains format choice, resizing, compression levels, and gallery preparation, but stops short of describing JPEG’s encoding internals.
Examples
Uses hero images, thumbnails, full-size gallery photos, and 2048 × 1365 example images to demonstrate JPEG choices.
What you can do after
Operate/configure it by choosing JPEGs, resizing images, and setting compression to balance visual quality against file size.
How it connects
Connects JPEG with PNG, GIF, SVG, HTML img elements, image compression, thumbnails, and photographic galleries.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.