The fine detail of images using HTML

In previous columns we investigated some basic image tips and the necessary syntax for coding an image into your Web site.

<IMG src="picture.jpg" alt="This is a picture" border="0" width="150" height="150">

This time we look in more detail at the images themselves: their properties, where you can find them, and how to optimise them for the Internet.


When teaching HTML, I have often been asked how to create the actual graphic with code. Many people don't realise that the creation of the image is separate to its insertion into a Web site. Graphics are created as separate entities which may or may not be used on Web pages, in the same way that they may or may not be used for word processing, or with greeting card software.

GIFs and JPGs

There is a variety of uses for images, and therefore a variety of image formats. Usually you can tell what file type you have by looking at the extension (the last letters after the full stop in the filename). For the Internet, the dominant file formats are GIFs and JPEGs (JPGs). They should be set to a resolution of 72dpi (dots per inch) for Web use.

GIFs are used for graphics that don't require an extensive range of colours. Most clipart or cartoon-style images are GIFS. Additionally, most animated graphics you see on the Internet are in this format. JPGs, on the other hand, are for images that are generally of photographic quality and that usually require many shades of the same colour.

The use of images in your Web site comes with a potential drawback. If too many are used or your images are not optimised for Internet viewing, they may increase the load time of your site. To overcome this, many graphic programs, such as Adobe Photoshop, allow you to optimise your images to a smaller file size without losing picture quality.

However, if you don't have access to such a program, Web sites have services that will do this for you. Take Net Mechanic ( as an example. Simply enter the URL of your graphic or, alternatively, upload it from your local machine. The site will then return a number of variations of your image; choose where the balance between file size and image quality is best, and save that version onto your local machine for use on your site. See FIGURE 1 for example results of a given image.

Image location

There are two main ways to collect your images for the Internet: either search the Internet for the graphic (animated, static or photograph), or create it electronically yourself.

For the purposes of this discussion, let's assume you want to locate a moving picture of a dog. Simply go to a search engine such as Yahoo ( and, in the search box, type "free images" & "dog" & "animated gif". You will be confronted with thousands of sites with potential images you could save.

To save an image from the Internet, simply hover your mouse over the image, right-click your mouse and select Save Picture As. You can then determine where on your computer you want to save it, and reference it accordingly in your code.

Alternatively, you can link to a graphic while it is on someone else's server using the absolute URL of the graphic. A potential problem with this route is that if that site's server goes down, viewers won't be able to see the graphic on your Web site any more. This is definitely not the best option.

Using this search technique, you can locate backgrounds, animated graphics, dividers and bullets, as well as normal photographs... many for free. It is very important to check the copyright on images before you use them on your Web site, just in case.

The second way to collect images is to create them yourself; previous Here's How Graphics columns will give you more infor­mation on this. With the right knowledge, you can create your own standard images, animated graphics, scan in images or even use photos from a digital camera.

Following this advice, not only will you know more about images but you'll be able to insert them into your Web site and be sure they are at minimum size and maximum quality for your situation.

Join the PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Heidi Woof

PC World
Show Comments

Most Popular Reviews

Latest News Articles


PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?