Compress the background photo, give phones a smaller version cropped for their screens, let it move with the page rather than stay fixed, and set a background colour so text is readable before the photo arrives.

A photo behind everything

A site's design sets one large photograph behind every page: a mountain view, a job site, a product in soft focus. On a desktop screen it looks striking.

On a phone the same page is slow to appear, the text sits on a blank background until the photo arrives, and on some phones scrolling stutters as if the page were heavy to push.

The photo is usually the heaviest file on the page by far, often a couple of megabytes. It downloads with whichever page a visitor opens first, and that is the page they judge the site by.

Why a phone pays for the whole photo

A background image is set in the site's style code, and the browser downloads the whole file however little of it shows.

On a tall, narrow phone screen, a photo set to cover the background shows only a vertical strip of a wide view. The phone still downloads every pixel and decodes the full image into memory before trimming it.

On a mobile connection that download can take many seconds, and on a data plan someone pays for it, to see a strip of sky.

What the photo costs a visit

A full-screen background adds several kinds of work, and phones feel all of them.

The third explains the stutter. Some phone browsers ignore a fixed background altogether, and those that honour it must redraw the photo behind the moving text with every movement, which slower phones cannot keep up with.

Compressing the photo

Most background photos are saved at a size and quality meant for print. A photo shown behind text, often under a tinted overlay, needs neither.

Resize it to the widest screen the site expects, around 1,600 to 2,000 pixels, and export the JPEG with its quality turned well down from the maximum. Detail lost to compression rarely shows behind text.

A progressive JPEG can help as well. Many browsers show it blurred at first and sharpen it as it loads, instead of drawing it slowly from the top down.

A smaller photo for small screens

Style code can give small screens a different file. A rule that applies only below a certain width can point to a version a few hundred pixels wide, cropped to the part of the photo that matters.

Browsers generally fetch only the background image that applies to the screen in front of them, so a phone takes the small file and a desktop the large one.

Some sites drop the photo on phones altogether, in favour of a plain colour taken from it. On a small screen the words matter more than the picture behind them.

Letting it scroll with the page

A fixed background gives a sense of depth on a large monitor. On a phone it brings work and little else.

Letting the photo scroll with the page removes the constant redrawing. Where the fixed effect matters to the design, it can be kept for wide screens only.

A worked example

A pile driving contractor in Prince George drives foundation piles for bridges, industrial buildings and docks across the north. Engineers and site superintendents often look up its details on a phone from a job site.

Its site set a photo of a rig at dusk behind every page, fixed in place. The file was 2,600 pixels wide, saved at maximum quality, and weighed about three megabytes.

On a phone the pages appeared slowly, white text floated on an empty background while the photo loaded, and scrolling through the project list stuttered.

The photo was resized and compressed, a narrow crop of the rig was made for small screens, and the background now scrolls with the page. A dark background colour sits beneath it, so the text can be read at once.

A superintendent on one bar of signal now has the phone number on screen before the photo finishes arriving, and the desktop view looks much as it did.

Readable before the photo arrives

Set a background colour close to the photo's main tone, beneath the image. Light text then has a dark surface to sit on while the photo loads, or if it never does.

Choose text and overlay colours against the lightest part of the photo, not the darkest, since each screen size shows a different crop.

Check each page with images turned off, or over a slow connection, and make sure every word can be read without the photo.

Measuring the weight

The network panel in a browser's developer tools lists each download behind a page and how heavy it is. Ordered by weight, the background photo usually comes out on top.

Note the size before and after each change, so the difference is visible in the same tool.

Then open the page on a phone over a mobile connection, not only on the office network, where a three-megabyte photo can seem to arrive instantly.

The counter-case

For a photographer, a resort or a builder whose work is the selling point, a large photo can be the most important thing on the home page, and shrinking it to nothing would miss what visitors came for.

Even there, the photo can be compressed, sized for each screen and kept to the pages where it matters. Visitors still see the work without carrying it on every page.

A designer can usually keep the look of a full-screen background while making it far lighter, so the choice is rarely between the photo and a fast page.

Lightening the background

  1. Find the background file and note its size.
  2. Resize it to the widest screen you expect.
  3. Save it as a progressive JPEG at moderate quality.
  4. Make a smaller crop for phone screens.
  5. Serve each screen the version it needs.
  6. Let the photo scroll with the page on phones.
  7. Set a background colour that keeps the text readable.

Step five is the change phone visitors feel. Once small screens get their own small file, a phone stops downloading a desktop photograph just to show a strip of it.

For another case of images weighing down every page, this time dozens of small ones drawing corners and shadows, see rounded corners and shadows built from dozens of images.


Frequently asked questions

Why does a background photo slow phones so much?

Phones download the whole file even when they show only a strip of it, then decode the full image into memory before trimming it to the screen.

What size should a background photo be?

Wide enough for the largest screen you expect, often 1,600 to 2,000 pixels, saved as a JPEG at moderate quality, with a much smaller version for phones.

Why does scrolling stutter on some phones?

A background fixed in place makes the browser redraw the photo behind the moving text as the page scrolls, and slower phones cannot keep up.

Can phones get a different background image?

Yes. A style rule that applies only to narrow screens can point to a smaller, cropped file, and browsers generally fetch only the image that applies.

Why is the text invisible until the photo loads?

Light text over a missing photo sits on a white page. Set a background colour close to the photo's tone, so the text can be read at once.

Should a photographer's site drop its big photos?

No. Where the photos are the work, keep them, but compress them, size them for each screen and keep them to the pages where they matter.

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.

A big photo behind every page of your site?

Tell us which site it is, and we will measure the background photo and suggest lighter versions for each screen size.

Start a Conversation