How to make your pages scream down the line

Web design

Your website looks great. The colours, the graphics, the content all work in unison, making for an experience not to be missed. Then someone points out that it takes 10 minutes to download on a 28.8 modem. What to do? Follow these simple guidelines to make your site scream down a phone line as fast as it would on a double T3.

Reduce the colour palette

Take a look at any graphic on the Web and more than likely it is going to be a GIF (Graphic Interchange Format). GIFs work by recording up to 256 different colours to be used in re-creating your graphic. This is called the palette. The file then records where each of these colours goes in the graphic. The thing is that each colour in the palette has to be recorded separately. The more colours used, the more memory it takes to record the palette and the longer it takes to download.

The fact is, though, that many graphics can be displayed just as well with much fewer than 256 colours. There is software on the market, such as Debabelizer (http://www. debabelizer.com), which will help you to optimise your graphics while still keeping the visual quality high. But if you don't have the cash to lay out for one of these, there are steps that you can take while indexing your graphic in a program such as PhotoShop to reduce the number of colours yourself. To prepare your GIF for the Web, I recommend the following process:

1. Index your GIF with an adaptive colour pallet at the 8-bit/pixel colour depth. This maximises the quality of the image while reducing the number of colours. If the image looks good at that colour depth, re-index it at the next level down and see how that looks. Keep reducing the colour depth until you notice that it has reduced the quality of the image. The lower the colour depth, the fewer the colours used in the palette.

2. Now switch the graphic back to RGB and re-index it one final time. This time the palette should automatically default to the exact number of colours needed to render the graphic.

3. Unfortunately for Web designers, PhotoShop shifts your colours when indexing, so that if you were using browser-safe colours, as you should (http://www.independent.co.uk/

net/980203ne/story6.html), they will not stay that way. This is easily remedied, though, by changing the browser-safe colour values back using the colour table.

4. Save your graphic as a GIF.

Use flat areas of colours

As I mentioned above, GIFs work by recording the colours in a graphic and then recording where each of those colours is used in the graphic. GIFs record this information in rows and when a single colour is used repetitively in a row, one way a GIF reduces the file size is by recording which colour is used and then how many times it is repeated, rather than repeating the information for each pixel. The upshot is that long rows of a single solid colour take less memory than a mixture of colours, and will download faster.

Reuse graphics

When a visitor comes to your Web site, all graphics are downloaded to their computer and then stored in the browser's cache. The cache remembers where each graphic came from - its URL - and when that same graphic is used again, the browser pulls it out of the cache rather than waiting to download it. Obviously, if the graphic is coming from your hard drive rather than the Internet it will load significantly faster. Using the same graphic in different locations on the same page or even on other Web pages means that it will download from the cache, regardless of where it is being used.

Stick with HTML text

This one is pretty straightforward. Graphics take longer to download than HTML code. Unless you have a good reason for needing the text in the graphics (drop shadows, backgrounds, special fonts and so forth), always put your text in the HTML.

Eliminate tables

Without tables, layout on the Web would be pretty boring. Tables give us control over the width, justification and placement of elements on the screen. But to get the results they want, many designers use tables nested in tables nested in tables. The fact is, though, that tables do take time to prepare and display in Web pages. The more tables being used, the longer the download time. You don't have to give up on tables entirely, but try to use one or two tables to create your layout, and avoid nested tables if at all possible.

E-mail your comments or questions to Jason Cranford Teague at indy_webdesign @mindspring. com

Arts and Entertainment
Nick Hewer is to leave The Apprentice after 10 years

TV review Nick Hewer, the man whose eyebrows speak a thousand words, is set to leave The Apprentice

Arts and Entertainment
Female fans want more explicit male sex in Game of Thrones, George R R Martin says

film George RR Martin owns a cinema in Santa Fe

Arts and Entertainment
Clued up: John Lynch and Gillian Anderson in ‘The Fall’

TV review

Arts and Entertainment
The Baker (James Corden) struggles with Lilla Crawford’s Little Red Riding Hood

film...all the better to bamboozle us
Arts and Entertainment
English: Romantic Landscape

art
PROMOTED VIDEO
Have you tried new the Independent Digital Edition apps?
Arts and Entertainment

ebooksNow available in paperback
Arts and Entertainment

ebooks
Arts and Entertainment
Mark, Katie and Sanjay in The Apprentice boardroom
TV
Arts and Entertainment

Film The critics but sneer but these unfashionable festive films are our favourites

Arts and Entertainment
Frances O'Connor and James Nesbitt in 'The Missing'

TV We're so close to knowing what happened to Oliver Hughes, but a last-minute bluff crushes expectations

Arts and Entertainment
Joey Essex will be hitting the slopes for series two of The Jump

TV

Who is taking the plunge?
Arts and Entertainment
Katy Perry as an Ancient Egyptian princess in her latest music video for 'Dark Horse'

music
Arts and Entertainment
Dame Judi Dench, as M in Skyfall

film
Arts and Entertainment
Morrissey, 1988

TV
Arts and Entertainment
William Pooley from Suffolk is flying out to Free Town, Sierra Leone, to continue working in health centres to fight Ebola after surviving the disease himself

music
Arts and Entertainment
The Newsroom creator Aaron Sorkin

TV
Arts and Entertainment
Matt Berry (centre), the star of Channel 4 sitcom 'Toast of London'

TVA disappointingly dull denouement
Arts and Entertainment
Tales from the cryptanalyst: Benedict Cumberbatch in 'The Imitation Game'

film
Arts and Entertainment
Pixie Lott has been voted off Strictly Come Dancing 2014

Strictly
Latest stories from i100
Have you tried new the Independent Digital Edition apps?

ES Rentals

    Independent Dating
    and  

    By clicking 'Search' you
    are agreeing to our
    Terms of Use.

    Homeless Veterans appeal: 'You look for someone who's an inspiration and try to be like them'

    Homeless Veterans appeal

    In 2010, Sgt Gary Jamieson stepped on an IED in Afghanistan and lost his legs and an arm. He reveals what, and who, helped him to make a remarkable recovery
    Could cannabis oil reverse the effects of cancer?

    Could cannabis oil reverse effects of cancer?

    As a film following six patients receiving the controversial treatment is released, Kate Hilpern uncovers a very slippery issue
    The Interview movie review: You can't see Seth Rogen and James Franco's Kim Jong Un assassination film, but you can read about it here

    The Interview movie review

    You can't see Seth Rogen and James Franco's Kim Jong Un assassination film, but you can read about it here
    Serial mania has propelled podcasts into the cultural mainstream

    How podcasts became mainstream

    People have consumed gripping armchair investigation Serial with a relish typically reserved for box-set binges
    Jesus Christ has become an unlikely pin-up for hipster marketing companies

    Jesus Christ has become an unlikely pin-up

    Kevin Lee Light, aka "Jesus", is the newest client of creative agency Mother while rival agency Anomaly has launched Sexy Jesus, depicting the Messiah in a series of Athena-style poses
    Rosetta space mission voted most important scientific breakthrough of 2014

    A memorable year for science – if not for mice

    The most important scientific breakthroughs of 2014
    Christmas cocktails to make you merry: From eggnog to Brown Betty and Rum Bumpo

    Christmas cocktails to make you merry

    Mulled wine is an essential seasonal treat. But now drinkers are rediscovering other traditional festive tipples. Angela Clutton raises a glass to Christmas cocktails
    5 best activity trackers

    Fitness technology: 5 best activity trackers

    Up the ante in your regimen and change the habits of a lifetime with this wearable tech
    Paul Scholes column: It's a little-known fact, but I have played one of the seven dwarves

    Paul Scholes column

    It's a little-known fact, but I have played one of the seven dwarves
    Fifa's travelling circus once again steals limelight from real stars

    Fifa's travelling circus once again steals limelight from real stars

    Club World Cup kicked into the long grass by the continued farce surrounding Blatter, Garcia, Russia and Qatar
    Frank Warren column: 2014 – boxing is back and winning new fans

    Frank Warren: Boxing is back and winning new fans

    2014 proves it's now one of sport's biggest hitters again
    Jeb Bush vs Hillary Clinton: The power dynamics of the two first families

    Jeb Bush vs Hillary Clinton

    Karen Tumulty explores the power dynamics of the two first families
    Stockholm is rivalling Silicon Valley with a hotbed of technology start-ups

    Stockholm is rivalling Silicon Valley

    The Swedish capital is home to two of the most popular video games in the world, as well as thousands of technology start-ups worth hundreds of millions of pounds – and it's all happened since 2009
    Did Japanese workers really get their symbols mixed up and display Santa on a crucifix?

    Crucified Santa: Urban myth refuses to die

    The story goes that Japanese store workers created a life-size effigy of a smiling "Father Kurisumasu" attached to a facsimile of Our Lord's final instrument of torture
    Jennifer Saunders and Kate Moss join David Walliams on set for TV adaptation of The Boy in the Dress

    The Boy in the Dress: On set with the stars

    Walliams' story about a boy who goes to school in a dress will be shown this Christmas