Have your developer replace the corner, shadow and shading images with style code, which current browsers draw themselves. Combine any small images that remain into one file, so phones download a handful of files rather than dozens.

A page made of small pieces

Load the home page of an older site on a phone over a mobile connection and watch it arrive. The text comes first, then boxes fill in a corner at a time.

Ask how many files the page loads and the answer can be sixty or seventy, most of them images a few pixels across: four corners for each box, two ends and a middle for each button.

None of those images is a picture in any ordinary sense. They are decoration, drawn the only way that worked when the site was built.

Why the images were there

Until recently, browsers could not draw a rounded corner, a soft shadow or a shaded button by themselves. Designers who wanted those effects cut them out of the design as small images.

The pieces were placed around each box and behind each button, often in layers, so the effect would stretch with the content. It was careful work and the standard way to build a polished site.

What changed is the browsers. Effects that once needed dozens of images can now be described in the style sheet, and the browser draws them itself.

What the images draw on a typical older page

Add them up across a header, a menu, three content boxes and a few buttons, and a page can request several dozen images before showing a single photograph.

The browser keeps copies once they arrive, but a first visit, often the only one a searcher makes, pays the full cost.

What each file costs a phone

Every file is a separate request. The browser asks the server for it, waits for an answer, and only then receives the file, however small.

On an office connection the waits are short. On a phone's mobile connection each request has a noticeable delay, and the browser fetches only a few files at a time from one server.

So dozens of tiny images queue behind each other. The phone spends more time waiting to start downloads than downloading, and the page arrives in fragments.

What current browsers draw for themselves

Current versions of Chrome, Firefox, Safari and Internet Explorer round the corners of a box or add a shadow from a single line of style code, and so do the browsers built into iPhones and newer Android phones.

Shading is drawn the same way, as a gradient described in the style sheet. A few browsers still need slightly different wording for it, which a developer adds as routine.

None of these effects needs a download, and all of them stretch to any size without new images.

Internet Explorer 8 and its square corners

Internet Explorer 8, the last version made for Windows XP and still on many office desks, does not draw rounded corners, shadows or gradients from style code. It shows square corners and plain boxes.

The page still works and reads normally. Shading falls back to a plain colour the developer chooses, and the layout does not change.

For most small business sites, square corners in an older browser are a fair trade. Scripts that fake rounded corners there add their own downloads and undo part of the gain.

A worked example

Near Vernon, a hot air balloon company takes passengers up over the North Okanagan at sunrise from spring to fall, selling flights for couples, families and small groups.

Its site dated from several years ago. Each flight package sat in a rounded box with a drop shadow, the booking buttons were shaded images, and the menu was built from tabs.

Passengers check the site on their phones on the morning of a flight, often from a hotel or a car, for the meeting point and whether the weather allows flying.

The home page was asking those phones for dozens of decoration images before it showed either.

The company's developer replaced the corners, shadows, shaded buttons and tabs with style code, and combined the remaining icons into a single image file.

A phone loading the home page now makes a handful of requests for the design rather than dozens, so the meeting point and the morning's notice arrive sooner.

On office computers running Internet Explorer 8, where many gift flights are booked, the same boxes simply appear with square corners.

The small images worth keeping

Not every small image should go. Logos, photographs and icons that carry meaning stay as images, and photographs should be saved at the size they are shown.

Icons can be combined into one file, often called a sprite, so the browser downloads them together. The style sheet then shows the right part of the file in each place.

Counting the files on a page

Chrome and Safari include developer tools that list each file a page requests, how large it is and how long it took. Your developer can count the requests in a minute.

A page that loads a few large photographs and a dozen other files is in reasonable shape. One that loads sixty small images before its first photograph has decoration doing the browser's job.

The counter-case

A site due for a full redesign within months may not be worth reworking now. The rebuild will replace the images anyway; the effort is better spent making sure it does not repeat them.

Some effects cannot be drawn with code, such as torn paper edges, hand-drawn frames or textured borders. Those still need images, combined into as few files as possible.

On fast office connections the difference can be small. But a growing share of visits comes from phones, and on a mobile connection every request still carries its wait.

Trading images for style code

  1. Count the requests the home page makes.
  2. List the images that only draw decoration.
  3. Replace corners and shadows with style code.
  4. Draw shading as gradients over a plain colour.
  5. Combine remaining icons into one file.
  6. Check the page in Internet Explorer 8.
  7. Load it on a phone over a mobile connection.

Step two shows where the gain is. A list of decoration images, page by page, tells the developer which templates to change first.

Another leftover from older ways of building sites, separate print pages that Google lists instead of the real ones, is explained in printer-friendly copies of every page in Google.


Frequently asked questions

Why did older sites use images for rounded corners?

Browsers at the time could not draw rounded corners, shadows or shading themselves, so designers cut those effects out of the design as small images placed around each box.

Can browsers draw these effects now?

Current versions of Chrome, Firefox, Safari and Internet Explorer draw rounded corners and shadows from a line of style code, with no image to download.

What happens in Internet Explorer 8?

It shows square corners and plain boxes, but the page still works and reads normally. Shading falls back to a plain colour the developer chooses.

Why do small images slow a page down?

Each file is a separate request with its own wait for the server. Dozens of tiny files add up, especially on a phone's mobile connection, where each wait is longer.

What is an image sprite?

Several small images combined into one file, with the style sheet showing the right part of it in each place. The browser downloads one file instead of many.

Is this worth doing without a redesign?

Often, since it changes the style sheet and templates rather than the content. If a redesign is due within a few months, fold the change into it instead.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

An older site built from dozens of small images?

Pick the page that loads slowest on your phone, and we will count its files and show which images style code can replace.

Start a Conversation