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

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

ebooksNow available in paperback
Arts and Entertainment

ebooks
Arts and Entertainment
Christopher Eccleston (centre) plays an ex-policeman in this cliché-riddled thriller

TV review
Arts and Entertainment
Lena Headey looks very serious as Cersei Lannister in Game of Thrones

TV This TV review contains spoilers
Arts and Entertainment

film
Arts and Entertainment
Wiz Khalifa performs on stage during day one of the Wireless Festival at Perry Park in Birmingham

music
Arts and Entertainment
Festival-goers soak up the atmosphere at Glastonbury

music

Arts and Entertainment
Star Wars creator George Lucas

film

Arts and Entertainment

music

Arts and Entertainment
A shot from the forthcoming Fast and Furious 7

film

Arts and Entertainment
The new-look Top of the Pops could see Fearne Cotton returns as a host alongside Dermot O'Leary

TV

Arts and Entertainment
The leader of the Church of Scientology David Miscavige

TV

Arts and Entertainment
No half measures: ‘The Secret Life of the Pub’

Grace Dent on TV The Secret Life of the Pub is sexist, ageist and a breath of fresh air

Arts and Entertainment
Art on their sleeves: before downloads and streaming, enthusiasts used to flick through racks of albums in their local record shops
musicFor Lois Pryce, working in a record shop was a dream job - until the bean counters ruined it
Arts and Entertainment
Serial suspect: the property heir charged with first-degree murder, Robert Durst
TV review
Arts and Entertainment
Igarashi in her

Art Megumi Igarashi criticises Japan's 'backwards' attitude to women's sexual expression

Arts and Entertainment
Could Ed Sheeran conquer the Seven Kingdoms? He could easily pass for a Greyjoy like Alfie Allen's character (right)

tv Singer could become the most unlikely star of Westeros

Arts and Entertainment
Beyonce, Boris Johnson, Putin, Nigel Farage, Russell Brand and Andy Murray all get the Spitting Image treatment from Newzoids
tvReview: The sketches need to be very short and very sharp as puppets are not intrinsically funny
Arts and Entertainment
Despite the controversy it caused, Mile Cyrus' 'Wrecking Ball' video won multiple awards
musicPoll reveals over 70% of the British public believe sexually explicit music videos should get ratings
Arts and Entertainment
Lena Headey as Cersei Lannister and Ian Beattie as Meryn Trant in the fifth season of Game of Thrones

TV
Arts and Entertainment

book review
Arts and Entertainment
It's all in the genes: John Simm working in tandem with David Threlfall in 'Code of a Killer'

TV review
  • Get to the point
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.

    General Election 2015: Chuka Umunna on the benefits of immigration, humility – and his leader Ed Miliband

    Chuka Umunna: A virus of racism runs through Ukip

    The shadow business secretary on the benefits of immigration, humility – and his leader Ed Miliband
    Yemen crisis: This exotic war will soon become Europe's problem

    Yemen's exotic war will soon affect Europe

    Terrorism and boatloads of desperate migrants will be the outcome of the Saudi air campaign, says Patrick Cockburn
    Marginal Streets project aims to document voters in the run-up to the General Election

    Marginal Streets project documents voters

    Independent photographers Joseph Fox and Orlando Gili are uploading two portraits of constituents to their website for each day of the campaign
    Game of Thrones: Visit the real-life kingdom of Westeros to see where violent history ends and telly tourism begins

    The real-life kingdom of Westeros

    Is there something a little uncomfortable about Game of Thrones shooting in Northern Ireland?
    How to survive a social-media mauling, by the tough women of Twitter

    How to survive a Twitter mauling

    Mary Beard, Caroline Criado-Perez, Louise Mensch, Bunny La Roche and Courtney Barrasford reveal how to trounce the trolls
    Gallipoli centenary: At dawn, the young remember the young who perished in one of the First World War's bloodiest battles

    At dawn, the young remember the young

    A century ago, soldiers of the Empire – many no more than boys – spilt on to Gallipoli’s beaches. On this 100th Anzac Day, there are personal, poetic tributes to their sacrifice
    Dissent is slowly building against the billions spent on presidential campaigns – even among politicians themselves

    Follow the money as never before

    Dissent is slowly building against the billions spent on presidential campaigns – even among politicians themselves, reports Rupert Cornwell
    Samuel West interview: The actor and director on austerity, unionisation, and not mentioning his famous parents

    Samuel West interview

    The actor and director on austerity, unionisation, and not mentioning his famous parents
    General Election 2015: Imagine if the leading political parties were fashion labels

    Imagine if the leading political parties were fashion labels

    Fashion editor, Alexander Fury, on what the leaders' appearances tell us about them
    Phumzile Mlambo-Ngcuka: Home can be the unsafest place for women

    Phumzile Mlambo-Ngcuka: Home can be the unsafest place for women

    The architect of the HeForShe movement and head of UN Women on the world's failure to combat domestic violence
    Public relations as 'art'? Surely not

    Confessions of a former PR man

    The 'art' of public relations is being celebrated by the V&A museum, triggering some happy memories for DJ Taylor
    Bill Granger recipes: Our chef succumbs to his sugar cravings with super-luxurious sweet treats

    Bill Granger's luxurious sweet treats

    Our chef loves to stop for 30 minutes to catch up on the day's gossip, while nibbling on something sweet
    London Marathon 2015: Paula Radcliffe and the mother of all goodbyes

    The mother of all goodbyes

    Paula Radcliffe's farewell to the London Marathon will be a family affair
    Everton vs Manchester United: Steven Naismith demands 'better' if Toffees are to upset the odds against United

    Steven Naismith: 'We know we must do better'

    The Everton forward explains the reasons behind club's decline this season
    Arsenal vs Chelsea: Praise to Arsene Wenger for having the courage of his convictions

    Michael Calvin's Last Word

    Praise to Wenger for having the courage of his convictions