| the complete webmaster | ||||
| messages | tutorials | reviews | reference | |
|
A General Introduction of Using Graphics and Images on the WebIntroductionMulti-media audio and video files usually take most of the storage spaces at your website. Transmitting these huge files plays a major role of the your web server performance. Let us focus on the graphics and images in this article and get a better understanding of some terminologies, how important these files are to the server, and what time Java should come into play to have an impact on your system. Being able to properly manage files of graphics and images at your site can greatly reduce your server load and therefore speed up the transmission, especially making your site more user friendly for those people connecting the Internet through their modems at home. This is the major purpose of this article. I will start by clarifying what people usually mean by graphics and images. Then go on to explain how colors are produced and used on the web as well as what dimensions and formats are used to store those image and graphics files. Some tips that can be used to speed up the transmission at your site are given following the introductions. I also do a brief comparison on those approaches mentioned here using categories in user interaction, flexibility, storage space, etc. Hopefully, this will help you somewhat improve your site in terms of optimizing images and graphics. Graphics and ImagesAlthough these two terms are usually used to refer to almost the same thing by lots of people on the web, there are subtle differences in a more technical sense. Graphics is generally used to describe drawings that are produced by primitive geometric objects, e.g. points, lines, circles, etc. Designers should have full control of the graphics by re-arranging these geometric objects with different sizes and colors. For those gurus in computer graphics, they use mathematical equations to represent and generate complex graphics even with simulated lighting conditions. The following figure on the left is a typical example of graphics. Images are usually real-world photos and simply described by the visual combination of color dots which are called pixels. Through the perception of colors and spatial relationship among pixels, human eyes are able to recognize the pattern and interpret what objects are in the images. Figure on the right illustrates such an example. While saved in pixels without equations describing geometric features, graphics are thus images. On the other hand, images need to be completely analyzed to find out their orginal graphic / geometric structures. This is usually regarded as computer vision in the academic world.
Color, Dimension, and File FormatImages we often see on the web mix red, green, and blue channels to produce a color. Each channel is 8-bit encoded, i.e. 256 maximum. Therefore, a full-color image in this sense has 256 x 256 x 256 (i.e. 16 million!) distinct colors, while a reduced-color image typically has fewer than 256 colors. For most human eyes, more than 256 colors in images and graphics are hardly distinguishable. Reducing number of colors has a direct impact of making file size smaller. The following figures are some of the examples.
Dimensions of an image are the metrics of width (left to right) and height (top to bottom) in pixels. Two of the most popular image formats with compression are JPG and GIF. Only GIF 89a format supports built-in multiple images that can be recognized by your web browsers while JPG offers better compression ratio most of the time. However, JPG is a lossy approach that will have a slight influence on the image details. TipsNow I am categorizing tips of using images and graphics as follows:
SummaryThis article is intended to give you a general introduction how you should manage the use of graphics and image files. In the case you probably need to use Java for animation, there is a tiny free program available called Animator in the standard JDK release that simply plays the precomputed sequence although I do not recommend its usage. For another Java animation case using image processing, please check out my previous article. In a series of future articles coming up next, I will walk through the codes of most common applets on the web, including scrollers, clocks, banners, mailers, etc. I assume those are what most people have a greater interest in, either for Java beginners or simply users. NEXT: Scrollers
Author: Chunyen Liu
More articles about Java |
| write for us | about us | advertise |
Copyright 1997, 1998 A Big Lime. All rights reserved.