How to Prepare Images for Your Web Site - Part 1



Get Web Design Tips and Tricks on mps-web-design.com. How to Prepare Images for Your Web Site - Part 1 topic will increase your understanding on Web Design Tips and Tricks. We at mps-web-design.com only provide news, articles, information in Web Design Tips and Tricks. Web Design Tips and Tricks at mps-web-design.com provides the most up to date news and articles. If you have questions please do not hesitate to contact us.

You are staring at the your monitor waiting for the image to
download. It finally appears but it has blurry edges. You go to
the next page but can't read the text because of the dark image
in the background. The next page has animated images, that don't
seem to stop. The spinning globes keep spinning. The last page
has a large graphic on it, which is a link. You click on it for
more information but it goes nowhere. You leave the site in
frustration.

Images are an essential ingredient for Web Site design.
You want visitors to have an aesthetically pleasing
experience. Properly preparing your images is necessary to
enhance the appearance of your web site. In Part I of this
article I will explain:

When to use images for your web site.
What image file formats should you use on the Web.

When to use images for your web site - Navigation
Graphical buttons can link to other pages or resources.

Image Maps – this is a graphic that contains several links on
it. It has several 'hot spots' or invisible buttons, you can
click on. For example you could have a photograph of your family
and put a hot spot on each person's face that links to that
person's web site.

Logos and Trademarks – your business or organization's trademark
are crucial for name recognition and branding.

Thumbnails – this is a small, 'thumbnail-sized version of an
image. When you click on it, you jump to another page with a
larger version of the same image. The visitor can see many
different, small images on the first page without having to wait
for larger files of the larger images to load.

What are the different image file formats?
Web graphics can be categorized into two file formats:
bitmap and vector.
Bitmap – these are composed of individual values for each color
displayed. The larger the dimensions of the image, the larger
the associated file size will be for the same graphic. When
viewed with magnification, a bitmap resembles a series of little
squares, each of which has a color value that contributes to the
overall shape. Bitmaps have a very rough appearance when viewed
closely but form images when viewed from a distance.

Bitmaps are best suited for photos, drop-shadow effects and
soft, glowing or blurry edges.

Vector – these store information about the image in mathematical
instructions that are then interpreted and displayed.

Vector graphics are best suited for line art, shapes and
illustrations.

Image File Formats
Graphic file formats used on the Web are GIF, JPEG and PNG

Graphics Interchange Format (GIF)
GIF is a platform-independent file format that is limited to a
display of 256 colors. GIF has been adopted by most developers
because of its small file size.

GIF is considered a 'lossless' format. This means that as the
image is compressed, no information is lost.

Types of GIFs
Animated GIF (89A) This 89a version of GIF allows storage
and playback of a sequence of still images to create the
illusion of animation. Animated GIF files consist of sequential
frames that reload from a browser's cache and replay in an
infinite or predetermined loop to simulate motion.

Transparent GIF
An advantage that a GIF has over a JPEG image is that the
designer can designate a color of the GIF image to be
transparent. For example, you can create a circular logo in a
square image by making the background color transparent. The
image appears circular, when, in fact, it is square with
information to appear transparent.

Interlaced GIF
Graphic interlacing (the progressive rendering of images)
is unique to GIFS and is the preferred method for
display of large graphic files. Many people find the
'fuzzy-to-sharp' animated effect of interlacing visually
appealing, but the most important benefit of interlacing is that
it gives the reader a preview of the full area of the picture,
while the picture downloads into the browser.

When to use a GIF
Buttons, bullets and navigational tools that accent your
Web pages. Interlacing is best for larger GIF images
such as illustrations and photographs.

Joint Photographic Experts Group (JPEG)
Graphics in the JPEG format are capable of much greater color
depth than GIFs, but usually require more time to download.
JPEG can contain up to 24 bits of color information
(16.7 million colors). Remember though, that most users are only
capable of displaying 8-bit color.

When to use a JPEG
JPEG enables you to use brilliant colors and provides support
for complex images and digitized photographs but it is not
designed for use with simple images.

JPEG compression is not as effective as GIF compression and may
distort images with few colors or large areas of the same color.
JPEG compression is therefore not designed for low-resolution
images.

Portable Network Graphics (PNG)
The PNG file format is emerging as the new format for Web graphics.
PNG files are lossless and support transparency like GIFs, yet also
support compression and high bit depth like JPEGs. In addition,
PNG bit depth can be adjusted, unlike GIFs or JPEGs, which must
be 8-bit and 24-bit depth.

When to use a PNG
PNGs behave similarly to GIFs and work best with flat-color,
sharp-edged art. PNGs compress both horizontally and vertically,
so solid blocks of color generally compress best. They also support
better interlacing than interlaced GIFs.

Knowing what types of graphics to use and when to use them for
your web site will help you avoid the many pitfalls of bad web
design.

Part 2 of this article will discuss how to optimize graphics for
your web site and factors that affect optimization.



New Niche! Earn 65% Plus Bonuses! - How to Prepare for the Bird Flu is in very high demand! Good money!
Microwave Meals And Recipes. - Quick and Tasty Recipes You Can Easily Prepare In Your Microwave Oven!

This post was originally published on May 13th, 2004. As others are writing about the topic, I thought bringing it out of the archives would be worthwhile.

A little recap

The idea of placing multiple states of buttons and other elements that are used in background images took its roots, I believe, from Pixy's Fast Rollovers. The CSS Zen Master extended this to another purpose in CSS Sprites: Image Slicing’s Kiss of Death. Didier Hilhorst came up with a nice application of this method, and I worked it backwards in Responsible CSS - Recycle your background images.

The idea behind the 'sprites' method can obviously be extended to any html element, and there are tangible benefits for doing this, just as long as the designer does his or her usual homework.

Benfits of using the 'sprites' method

What are the possible the benefits of using this method? Essentially it lies in faster download times for your web content.

Readers of Andy Kings book, Speed Up Your Site: Web Site Optimization will notice that this method reduces http requests and makes more efficient use of the data packets used to transfer files to the users computer, and that that is a good thing.

Packet size and http requests

From Web Page Design and Download Time, by Jing Zhi of Keynote Systems (seen here - pdf), cited in Andy's book:

The basic performance principle is therefore to make fewer requests and transmit fewer packets. From this principle, we can derive two basic design rules for wellperforming Web pages. First, reduce the overall size of the page, thereby reducing the number of bytes (and packets) to be transferred over the Internet. Second, limit the number of embedded objects on the page, such as images, each of which must be requested and transferred separately from server to browser.

They also found that it was the number of packets and not necessarily the overall size of the page that was important. If a packet could hold 1460 bytes (the figure given in the article) and your object was 1600 bytes, it would require two packets. They found that this object would transfer at the same speed as another object that was greater in size but still fit in two packets.

Potential payoff

The potential payoff for using this method versus individual images, then, is a faster download time due to reduced number of packets and fewer http requests.

Reducing http requests is easy. One file instead of two or three etc. is simple. But packet requests? That depends...

An example

The number of packets sent will depend on the size of the file and the users internet connection.

As an example, lets look at the fiftyfoureleven.com logo at the top of the page. When this design was first being coded, that link consisted of two 3.34kb images, one for the link state and one for the hover state. Now, by using one image that contains both states and simply bumping it back and forth depending on the hover state, that has been reduced to one 5.35 kb image. Right there is a savings of 1.33 kb. Good news.

Now, for arguments sake lets say that a packet can hold 1460 bytes (packet size for connections greater than 128kb/s = 1500 bytes -40bytes for tcp/ip headers). The two image method used 6 packets, 3 for each image (3.34/1.46, rounded up). The single image method uses 4 packets (5.34/1.46, rounded up).

Things are looking good.

How to optimize

In his alistapart article, Dave refers to the image that holds all of the sprites as his 'master image'. The key to benefitting from this method is to ensure that the file size of your master image isn't a bloated equivalent versus the sum of its pieces.

Conclusion

Great benefits can be realized when combining a master image from slices that fall well below the size of one packet, as that unused packet space goes wasted.

After doing a little more research, it seems that packet size can vary depending on the connection rate. That being said, it may be rather difficult to come up with a firm rule here. To play it smart and safe, try and:

  • build master images that are smaller then the sum of their collective slices (by combining images of similar colors, for example) or
  • rather than use a different distinct image for a certain element, reuse one that you already plan on using elsewhere.

This isn't exactly groundbreaking advice, however having seen the results acheived with the logo on this page, it can be seen that using the sprite method versus individual images at minimum does reduce http requests and even further it can reduce file size which in turn can reduce the number of packets sent.



Article Index: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79


More Articles:


1. IS YOUR WEB SITE UNFRIENDLY? PARTS 3 and 4 of 9
Part 3: Sound FilesIf you must put MIDI sound files on your page make them sothat visitors have to ask to hear the file--maybe bypressing the 'start' button. Apart from the fact thatvisitors may find the music objectionable, there's a goodchance:1 they are surfing late at night or early in the morningwhen other people are sleeping;2 they are listening to the radio or a CD and will beirritated when your sound file drowns it;3 they may even be trying to look busy during a lull atwork, and the soun…

2. Great Advantages of Printing Software
The printing software permits the users of all ages to produce tickets and other printing materials employing their own artistic talents and creativity. For instance, ticket printing software authorizes the users to have their own way of making and printing different kinds of tickets and printing materials.Not to mention that this software also allows you to have your own design, layout and style of greeting cards, business cards and the invitation cards which are very in demand most of the time…

3. KIS - Keep It Simple By Mike Marinaro
There are many ways to add fancy bells and whistles to your website, but most of them are not going to do you any good. In fact they will slow down the time it takes to load your website and take up valuable space that you are paying for. Besides that, people with older computers will not even be able to see some of these fancy additions you are using.For example Flash intro pages may be fancy and exciting to look at, but search engine robots and spiders do not read flash pages and you may act…

4. Why order Catalogs from Printing Companies?
If your target is to provide your customer's demand for sufficient information, catalog printing is the best option. Catalogs provide detailed information for your products and you will be able to stimulate orders from the customers immediately. With the selection of sizes, catalog printing services can offer you the popular 8-1/2 X 11 sizes of catalogs or the 5-1/2 x 8-1/2 sizes. With the clever use of catalogs, you can expect to increase your sales than just having a website alone. If it is …