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

PROMOTED VIDEO
Have you tried new the Independent Digital Edition apps?
Arts and Entertainment
Gal Gadot as Wonder Woman

film
Arts and Entertainment
Pedro Pascal gives a weird look at the camera in the blooper reel

TV
Arts and Entertainment
Public vote: Art Everywhere poster in a bus shelter featuring John Hoyland
art
Arts and Entertainment
Peter Griffin holds forth in The Simpsons Family Guy crossover episode

TV
Arts and Entertainment
Judd Apatow’s make-it-up-as-you-go-along approach is ideal for comedies about stoners and slackers slouching towards adulthood
filmWith comedy film audiences shrinking, it’s time to move on
Arts and Entertainment
booksForget the Man Booker longlist, Literary Editor Katy Guest offers her alternative picks
Arts and Entertainment
Off set: Bab El Hara
tvTV series are being filmed outside the country, but the influence of the regime is still being felt
Arts and Entertainment
Red Bastard: Where self-realisation is delivered through monstrous clowning and audience interaction
comedy
Arts and Entertainment
O'Shaughnessy pictured at the Unicorn Theatre in London
tvFiona O'Shaughnessy explains where she ends and her strange and wonderful character begins
Arts and Entertainment
The new characters were announced yesterday at San Diego Comic Con

TV
Arts and Entertainment
Rhino Doodle by Jim Carter (Downton Abbey)

TV
Arts and Entertainment
No Devotion's Geoff Rickly and Stuart Richardson
musicReview: No Devotion, O2 Academy Islington, London
Arts and Entertainment
Christian Grey cradles Ana in the Fifty Shades of Grey film

film
Arts and Entertainment
Comedian 'Weird Al' Yankovic

Is the comedy album making a comeback?

comedy
Arts and Entertainment
While many films were released, few managed to match the success of James Bond blockbuster 'Skyfall'
film
Arts and Entertainment
Jamie Dornan as Christian Grey in the first-look Fifty Shades of Grey movie still

film
Arts and Entertainment
Sue Perkins and Mel Giedroyc, centre, are up for Best Female TV Comic for their presenting quips on The Great British Bake Off

TV
Arts and Entertainment
Martin Freeman as Lester Nygaard in the TV adaptation of 'Fargo'

TV
Arts and Entertainment
A scene from Shakespeare in Love at the Noel Coward Theatre
theatreReview: Shakespeare in Love has moments of sheer stage poetry mixed with effervescent fun
Arts and Entertainment
Dwayne 'The Rock' Johnson stars in Hercules

film
Independent
Travel Shop
the manor
Up to 70% off luxury travel
on city breaks Find out more
santorini
Up to 70% off luxury travel
on chic beach resorts Find out more
sardina foodie
Up to 70% off luxury travel
on country retreats Find out more
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.

    Save the tiger: The animals bred for bones on China’s tiger farms

    The animals bred for bones on China’s tiger farms

    The big cats kept in captivity to perform for paying audiences and then, when dead, their bodies used to fortify wine
    A former custard factory, a Midlands bog and a Leeds cemetery all included in top 50 hidden spots in the UK

    A former custard factory, a Midlands bog and a Leeds cemetery

    Introducing the top 50 hidden spots in Britain
    Ebola epidemic: Plagued by fear

    Ebola epidemic: Plagued by fear

    How a disease that has claimed fewer than 2,000 victims in its history has earned a place in the darkest corner of the public's imagination
    Chris Pratt: From 'Parks and Recreation' to 'Guardians of the Galaxy'

    From 'Parks and Recreation' to 'Guardians of the Galaxy'

    He was homeless in Hawaii when he got his big break. Now the comic actor Chris Pratt is Hollywood's new favourite action star
    How live cinema screenings can boost arts audiences

    How live cinema screenings can boost arts audiences

    Broadcasting plays and exhibitions to cinemas is a sure-fire box office smash
    Shipping container hotels: Pop-up hotels filling a niche

    Pop-up hotels filling a niche

    Spending the night in a shipping container doesn't sound appealing, but these mobile crash pads are popping up at the summer's biggest events
    Native American headdresses are not fashion accessories

    Feather dust-up

    A Canadian festival has banned Native American headwear. Haven't we been here before?
    Boris Johnson's war on diesel

    Boris Johnson's war on diesel

    11m cars here run on diesel. It's seen as a greener alternative to unleaded petrol. So why is London's mayor on a crusade against the black pump?
    5 best waterproof cameras

    Splash and flash: 5 best waterproof cameras

    Don't let water stop you taking snaps with one of these machines that will take you from the sand to meters deep
    Louis van Gaal interview: Manchester United manager discusses tactics and rebuilding after the David Moyes era

    Louis van Gaal interview

    Manchester United manager discusses tactics and rebuilding after the David Moyes era
    The children were playing in the street with toy guns. The air strikes were tragically real

    The air strikes were tragically real

    The children were playing in the street with toy guns
    Boozy, ignorant, intolerant, but very polite – The British, as others see us

    Britain as others see us

    Boozy, ignorant, intolerant, but very polite
    Countries that don’t survey their tigers risk losing them altogether

    Countries that don’t survey their tigers risk losing them

    Jonathon Porritt sounds the alarm
    How did our legends really begin?

    How did our legends really begin?

    Applying the theory of evolution to the world's many mythologies
    Watch out: Lambrusco is back on the menu

    Lambrusco is back on the menu

    Naff Seventies corner-shop staple is this year's Aperol Spritz