Hour 10. Creating Images for Use on the Web


What You’ll Learn in This Hour:

Image How to select a software package to use

Image How to prepare photographs for use online

Image How to create banners and buttons

Image How to reduce the number of colors in an image

Image How to create transparent images

Image How to prepare an image for a tiled background

Image How to create animated web graphics


Believe me, you don’t have to be an artist by trade to put high-impact graphics on your web pages (although it does help). You don’t need to spend hundreds or thousands of dollars on software packages, either, just to manipulate digital photographs or other source graphics you might want to use. The topics in this hour help you get started with creating images you can use in your website.

Although the sample figures in this hour use a popular and free graphics program for Windows, Mac, and Linux users (GNU Image Manipulation Program, or GIMP), you can apply the knowledge you learn in this hour to any major Windows or Macintosh graphics application—although the menus and options will look different, of course.

After you learn to create the graphics themselves, you’ll be ready to include them in your website using HTML, CSS, or both.

Choosing Graphics Software

You can use almost any graphics program to create and edit images for your website, from the simple painting or drawing program that typically comes free with your computer’s operating system, to an expensive professional program such as Adobe Photoshop. Similarly, if you have a digital camera or scanner attached to your computer, it probably came with some graphics software capable of creating images suitable for online use. Several free image editors also are available for download—or even online as a web application—and deal just with the manipulation of photographic elements.

If you already have software you think might be good for creating web graphics, try using it to do everything described in these next sections. If your software can’t handle some of the tasks covered here, it probably isn’t a good tool for web graphics. In that case, download and install GIMP from www.gimp.org. This fully functional graphics program is completely free and can definitely perform the actions shown in this chapter.


Note

Without a doubt, Adobe Photoshop is the cream of the crop when it comes to image-editing programs. However, it is expensive and quite complex if you don’t have experience working with computer graphics. For more information on Adobe’s products, visit the Adobe website at http://www.adobe.com/. If you are in the market for one of the company’s products, you can download a free evaluation version from the site.



Using Images Found Elsewhere

One of the best ways to save time creating the graphics and media files for web pages is, of course, to avoid creating them altogether. Grabbing a graphic from any web page is as simple as right-clicking it (or Option + Click an Apple mouse) and selecting Save Image As or Save Picture As (depending on your browser). Extracting a background image from a page is just as easy: Right-click it and select Save Background As.

However, you should never use images without the explicit permission of the owner, either by asking or by looking for a Creative Commons license. To take images without explicit permission is a copyright violation (and is also distasteful). To learn more about copyrights, I recommend the “Copyright Crash Course” online tutorial from the University of Texas, at http://copyright.lib.utexas.edu/.

You might also want to consider royalty-free clip art, which doesn’t require you to get copyright permission. A good source of clip art online is Microsoft’s Office Online Clip Art and Media website, at http://office.microsoft.com/clipart/. Clipart.com is another popular clip art destination; for a small fee, you have access to thousands of stock images.


If GIMP doesn’t suit you, consider downloading the evaluation version of Adobe Photoshop or Corel DRAW. For photo manipulation only, you have many free options, all with helpful features. Google’s Picasa, available free at http://picasa.google.com/, is one such option. Pixlr (pixlr.com) is another good option. Both of these programs are suited for editing images rather than creating them from scratch, and Picasa is also oriented toward organizing your digital photograph collection. These types of programs won’t necessarily help you design a banner or button image for your site, but they can help you work with some supplementary images, and they are powerful enough that they’re worth checking out.

The Least You Need to Know About Graphics

Two forces are always at odds when you post graphics and multimedia on the Internet. The users’ eyes and ears want all your content to be as detailed and accurate as possible, and they also want that information displayed immediately. Intricate, colorful graphics mean big file sizes, which increase the transfer time even over a fast connection. How do you maximize the quality of your presentation while minimizing file size? To make these choices, you need to understand how color and resolution work together to create a subjective sense of quality.

The resolution of an image is the number of individual dots, or pixels, that make up an image (typically 72 dots per inch, or 72dpi). Large, high-resolution images generally take longer to transfer and display than small, low-resolution images. Image dimensions are usually specified as the width times the height of the image, expressed in pixels; a 300×200 image, for example, is 300 pixels wide and 200 pixels high.

You might be surprised to find that resolution isn’t the most significant factor in determining an image file’s storage size (and transfer time). This is because images used on web pages are always stored and transferred in compressed form. Image compression is the mathematical manipulation that images are put through to squeeze out repetitive patterns. The mathematics of image compression is complex, but the basic idea is that repeating patterns or large areas of the same color can be squeezed out when the image is stored on a disk. This makes the image file much smaller and allows it to be transferred faster over the Internet. The web browser then restores the original appearance of the image when the image is displayed.


Note

Several types of image resolution are used, including pixel, spatial, spectral, temporal, and radiometric. You could spend hours just learning about each type—and if you were taking a graphics design class, you might do just that. For now, however, all you need to remember is that large images take longer to download and also use a lot of space in your display. Display size and storage or transfer size are factors to take into consideration when designing your website.


In the sections that follow, you learn how to create graphics with big visual impact but small file sizes. The techniques you use to accomplish this depend on the contents and purpose of each image. There are as many uses for web graphics as there are web pages, but four types of graphics are by far the most common:

Image Photos of people, products, and places

Image Graphical banners and logos

Image Buttons or icons to indicate actions and provide links

Image Background textures for container elements

Preparing Photographic Images

To put photos on your web pages, you need to convert your print-based photos to digital images or create photos digitally by using a digital camera, which includes the ubiquitous camera in your smartphone. In the case of some older models of hardware, you might need to use the custom software that came with your device to transfer images to your hard drive, but in most cases, you should be able to connect your device and then drag and drop files to your hard drive. If you are using a scanner to create digital versions of your print photos, you can control just about any scanner directly from the graphics program of your choice—see your software documentation for details.


Tip

If you don’t have a scanner or digital camera, almost all film developers offer a service that transfers photos from 35mm film to a CD-ROM or DVD-ROM for a modest fee. You can then copy the files to your hard drive and use your graphics program to open and modify the image files.


After you transfer the digital image files to your computer, you can use your graphics program to crop, resize, color-correct, and compress to get them ready for use in your website.

Cropping an Image

Because you want web page graphics to be as compact as possible, you usually need to crop your digital photos. When you crop a photo, you select the area you want to display and crop away the rest.

Even after your image has been cropped, it might be larger than it needs to be for a web page. Depending on the design of a specific web page, you might want to limit large images to no more than 800×600 pixels (if it is shown on a page by itself, such as an item catalog) or even 640×480 pixels or smaller. When shown alongside text, images tend to be in the range of 250 to 350 pixels for width, so there’s just enough room for the text as well. In some cases, you might want to also provide a thumbnail version of the image that links to a larger version; then you’ll probably stick closer to 100 pixels in the larger dimension for the thumbnail.


Tip

Your graphics software will likely have an omnipresent size display somewhere in the image window itself. In GIMP, you can see the current image size in the window title bar. Other programs might show it in the lower-right or lower-left corners. You might also see the magnification ratio in the window, and you might be able to change it by zooming in or out.


Resizing an Image

The exact tool necessary to change an image’s size depends on the program you are using. In GIMP, go to the Image menu and click Scale Image to open the Scale Image dialog box (see Figure 10.3).

Image

FIGURE 10.3 Use the Scale Image dialog box to change the size of an image.

You’ll almost always want to resize using the existing aspect ratio, meaning that when you enter the width you’d like the image to be, the height is calculated automatically (and vice versa), to keep the image from squishing out of shape. In GIMP, the aspect ratio is locked by default, as indicated by the chain link displayed next to the Width and Height options shown in Figure 10.3. Clicking once on the chain unlocks it, enabling you to specify pixel widths and heights of your own choosing—squished or not.


Note

As with many of the features in GIMP, the Scale Image dialog box appears in front of the window containing the image being resized. This placement enables you to make changes in the dialog box, apply them, and see the results immediately.


In most, if not all, graphics programs, you can also resize the image based on percentages instead of providing specific pixel dimensions. For example, if my image started out as 1815×1721 and I didn’t want to do the math to determine the values necessary to show it as half that width, I could simply select Percent (in this instance, from the drop-down next to the pixel display in Figure 10.3) and change the default setting (100) to 50. The image width would then become 908 pixels wide by 861 high—and no math was necessary on my part.

Tweaking Image Colors

If you are editing photographic images instead of creating your own graphics, you might need to use some color-correction tools to get the photo just right. As in many image-editing programs, GIMP offers several options for adjusting an image’s brightness, contrast, and color balance, as well as a filter to reduce the dreaded red-eye. To remove red-eye using GIMP, go to Filters, click Enhance, and then click Red Eye Removal.

Most of these options are pretty intuitive. If you want the image to be brighter, adjust the brightness. If you want more red in your image, adjust the color balance. In GIMP, the Colors menu gives you access to numerous tools. As with the Scale Image dialog box described in the previous section, each tool displays a dialog box in the foreground of your workspace. As you adjust the colors, the image reflects those changes. This preview function is a feature included in most image-editing software.

Figure 10.4 shows the Adjust Hue/Lightness/Saturation tool, one of the many tools provided on the Colors menu. As shown in the figure, you can achieve many color-related changes by using various sliders in dialog boxes to adjust the values you are working with. The Preview feature enables you to see what you are doing as you are doing it. The Reset Color button returns the image to its original state without any changes applied.

Image

FIGURE 10.4 The Adjust Hue/Lightness/Saturation tool is one of many slider-based color-modification tools available in GIMP.

Because of the numerous tools available to you, and the preview function available with each tool, a little playful experimentation is the best way to find out what each tool does.

Controlling JPEG Compression

Photographic images on the web work best when saved in the JPEG file format rather than GIF; JPG enables you to retain the number of colors in the file while still keeping the overall file size to a manageable level. When you’re finished adjusting the size and appearance of your photo, select File, Export and choose JPEG as the file type. Your graphics program will likely provide you with another dialog box for controlling various JPEG options, such as compression.

Figure 10.5 shows the Export Image as JPEG dialog box you’ll see when you export a JPEG in GIMP. You can see here that you can control the compression ratio for saving JPEG files by adjusting the Quality slider between 1 (low quality, small file size) and 100 (high quality, large file size).

Image

FIGURE 10.5 GIMP enables you to reduce file size while still retaining image quality by saving in the JPEG format.

You might want to experiment a bit to see how various JPEG compression levels affect the quality of your images, but 85 percent quality (or 15 percent compression) is generally a good compromise between file size (and, therefore, download speed) and quality for most photographic images.

Creating Banners and Buttons

Graphics that you create from scratch, such as banners and buttons, require you to make considerations uniquely different from those that apply to photographs.


Tip

For many years, designing for 800×600 screen resolution was been the norm. Still keep that low number in mind because many people do not open applications in full-screen mode. However, designing for a baseline 1024×768 screen resolution is not a bad idea.


The first decision you need to make when you produce a banner or button is how big it should be. Most people accessing the web now have a computer with a screen that is at least 1024×768 pixels in resolution, if not considerably larger. For example, my screen is currently set at 1440×900 pixels; 1366×768 is another popular resolution. It’s a nice touch to plan your graphics so that they always fit within smaller screens (1024×768), with room to spare for scrollbars and margins. These days, though, you won’t run into much trouble if you’re designing for the desktop and nudge that minimal width up by a few pixels.

Assuming that you target a minimum resolution of 1024×768 pixels, full-size banners and title graphics should be no more than 900 pixels wide, which is the generally available viewable width of the page after you’ve accounted for scrollbars, toolbars, and other parts of the browser window. Within a page, normal photos and other images should be from 100 to 300 pixels in each dimension, and smaller buttons and icons should be 20 to 100 pixels tall and wide. Over the years, some generally acceptable sizes have been used for banner graphics and other advertisement-size images; you can see these sizes in use if you look at the banner ads available for affiliate and partner programs, such as the Amazon Affiliate program (see https://affiliate-program.amazon.com/). Common sizes include 120×600, 234×60, and 300×250, to name a new.

To create a new image in GIMP, go to File and choose New. The Create a New Image dialog box displays (see Figure 10.6). If you aren’t sure how big the image needs to be, just accept the default size of a 640×480. Or you can choose one of the other predetermined sizes in the Template drop-down, such as Web Banner Common 468×60 or Web Banner Huge 728×90. Those two settings are conservative, yet perfectly acceptable, interpretations of “common” and “huge” for banners. From this dialog box, you can also enter your own width and height for the new image.

Image

FIGURE 10.6 You must decide on the size of an image before you start working on it.

For the image’s background color, you should usually choose white to match the background that most web browsers use for web pages (although as you learned in the previous hour, that color can be changed). When you know that you’ll be creating a page with a background other than white, you can choose a different background color for your image. Or you might want to create an image with no background at all, in which case you select Transparency as the background color. When the final, web-ready image includes a transparent background, the web page (and its background color) behind the image is allowed to show through. In GIMP, select the background color for your new image by opening the Advanced Options in the Create a New Image dialog box.

After you enter the width and height of the image in pixels and click OK, you are faced with a blank canvas—an intimidating sight if you’re as art-phobic as most of us! However, so many image-creation tutorials (not to mention entire books) are available to lead you through the process that I’m comfortable leaving you to your own creative devices. This section is all about introducing you to the things you want to keep in mind when creating graphics for use in your sites. This section does not necessarily teach you exactly how to do it, because being comfortable with the tool you choose is the first step to mastering them.

Reducing or Removing Colors in an Image

One of the most effective ways to reduce the size of an image—and, therefore, its download time—is to reduce the number of colors used in the image. This can drastically reduce the visual quality of some photographic images, but it works great for most banners, buttons, and other icons.

You’ll be glad to know that there is a special file format for images with a limited number of colors, the Graphics Interchange Format (GIF). When you save or export an image as a GIF, you might be prompted to flatten layers or reduce the number of colors by converting to an indexed image because those are requirements for GIFs; check your software’s help file regarding layers and indexed colors for a full understanding of what you might need to do.

Remember, the GIF image format is designed for images that contain areas of solid colors, such as web page titles and other illustrated graphics; the GIF format is not ideal for photographs (use JPG or PNG files instead).

PNG (pronounced “ping”) is a useful file format that is supported in all major web browsers. Whereas the GIF image format enables you to specify a single transparent color, which means that the background of the web page will show through those areas of an image, the PNG format takes things a step further by enabling you to specify varying degrees of transparency.

You might have seen websites that use background colors or images in their container elements, but also have images present in the foreground that allow the background to show through parts of the foreground graphics. In these cases, the images in the foreground have portions that are transparent so that the images themselves—which are always on a rectangular canvas—do not show the areas of the canvas where the design does not occur. You often want to use these types of partially transparent images to make graphics look good over any background color or background image you have in place.

To make part of an image transparent, the image must be saved in the GIF or PNG file format. As mentioned previously in this lesson, most graphics programs that support the GIF format enable you to specify one color to be transparent, whereas PNG images allow for a range of transparency. Largely because of this transparency range, the PNG format is superior to GIF. All the latest web browsers already support PNG images.

The process of creating a transparent image depends on the type of image you are creating (GIF or PNG) and the graphics software you are using to create it. For instructions, look in your graphics program’s help files or type “transparent images with [your program here]” into your search engine.

Creating Tiled Background Images

You can use any GIF, JPG, or PNG image as a background tile within a container element, but before you go off and create a tiled background, especially a highly patterned tiled background, ask yourself what that tiled background adds to the overall look and feel of your website. More important, ask yourself whether the text of the site can be read easily when placed over that pattern.

Think about the websites you frequent every day, and consider the fact that few use tiled, heavily patterned backgrounds on their entire pages. If you restrict your browsing to websites for companies, products, sports teams, or other sites in which information (primarily text) is privileged, the number of sites with tiled, heavily patterned backgrounds decreases even further. The web affords everyone the right of individuality in design, but if you are creating a site for your business, you might want to avoid using a highly patterned background with contrasting colored text.

If you do use a tiled background image for your entire site, remember that tiled images look best when you can’t tell they’re tiled images. In other words, you know you have a good image when the top edge of a background tile matches seamlessly with the bottom edge, and the left edge matches with the right.

Figures 10.7 and 10.8 show background tiles in use, both with seamless background, but with varying degrees of effectiveness.

Image

FIGURE 10.7 This is an example of a seamless background image in which you can tell the background is tiled because you can see six identical shapes.

Image

FIGURE 10.8 This is also an example of a seamless background image, but you can’t tell that it’s tiled.

In Hour 11, “Using Images in Your Website,” you learn how to place background images within your container elements. Despite my warnings so far in this section, background images can be powerful weapons in your design arsenal—just not when heavily patterned. You can find some great (and freely available) examples of background images—often referred to as textures—at the Subtle Patterns website, http://subtlepatterns.com/. I haven’t shown an example of a good subtle tiled background because, for it to be an element of good design, it would likely be so subtle that it wouldn’t be visible in a printed book.

Creating Animated Web Graphics

The GIF image format enables you to create animated images that add some motion to spice up any web page. Animated GIF images also transfer much faster than most of the video or multimedia files that are often used for similar effect. With the GIMP software package, you can create animated GIFs by creating multiple layers within an image and then modifying the Animated GIF options when saving the file. Additionally, if you have a series of images you want to animate, you can use the free, web-based GIF animation service at Gickr (www.gickr.com).

The first step in creating a GIF animation is to create a series of images to be displayed one after the other—or a series of layers, depending on your particular software program. Each of these images is called a frame. Just like how movies or cartoons are put together, the images that you see on the movie or television screen and the images in animated graphics are made up of many individual frames that have slight differences in their appearance. When you have your graphical frames in mind, the process of tying them together is relatively simple—the planning stage is the most difficult. Take some time to sketch out the frames in storyboard fashion, especially if you plan to have more than just a few frames. When you know how your frames are going to fit together, use the Gickr service mentioned earlier in this section, or read the documentation for your graphics software to learn its particular process for pulling it all together.

Summary

In this hour, you learned the basics of preparing graphics for use on web pages. If nothing else, you learned that this is a complex topic, and you learned just enough in this chapter to whet your appetite. The examples in this chapter used the popular (and free!) GIMP software package, but feel free to use the graphics software that best suits your needs. Among the actions you learned were how to crop, resize, and tweak image colors, and you also learned about the different file formats. You must keep in mind many considerations when including graphics in your site, including graphic size and resolution, and how to use transparency, animated GIFs, and tiled backgrounds.

Q&A

Q. Instead of learning all this stuff myself, shouldn’t I just hire a graphics artist to design my pages?

A. This is a difficult question to answer—and that’s coming from someone who worked for a very long time for a web development and design agency. For individuals and small businesses, an agency isn’t always the best solution. Hiring a graphic designer takes time and money. Additionally, many graphics artists do not produce work suitable for the web—they are specifically print-based artists, and the print world is quite different than the online world. Furthermore, hiring a graphics designer to create a website might not play to the strengths of that particular graphics designer. In other words, the designer might be good at designing the graphical elements of a website, but he or she might not be a good content architect or might not excel at working with HTML and CSS. If your site is simply a personal site, a completely outsourced professional design might not be where you want to spend your money. But if your site is intended to promote a business, a product, a school, or anything else in which your image is integral to your success, it’s worth your while (and money) to consult with a web design professional at some point.

Q. I’ve produced graphics for printing on paper. Are web page graphics any different?

A. Yes. In fact, many of the rules for print graphics are reversed on the web. Web page graphics have to be low resolution, whereas print graphics should be as high resolution as possible. White washes out black on computer screens, whereas black bleeds into white on paper. Also, someone might stop a web page from loading when only half the graphics have been downloaded, which isn’t a consideration when looking at images in print. Try to avoid falling into old habits if you’ve done a lot of print graphics design.

Workshop

The Workshop contains quiz questions and exercises to help you solidify your understanding of the material covered. Try to answer all questions before looking at the “Answers” section that follows.

Quiz

1. You have a scanned picture of a horse that you need to put on a web page. How big should you make it? In what file format should you save it?

2. What are some issues to watch out for when selecting a tiling background image?

3. If you have a square image of a blue flower on a transparent background, and the background color of the containing element is gray, will your flower image appear on the page as a square or some other shape?

Answers

1. Depending on how important the image is to your page, you should make it as small as 100×40 pixels or as large as 300×120 pixels. The JPEG format, with about 85 percent compression, would be best. Of course, you could also provide a thumbnail link to a larger image that is viewed by itself.

2. You need to make sure that the tile “seams” aren’t visible when it repeats, that the pattern is not too overwhelming, and that the colors in the tile do not contrast with any other images or colors used on the page.

3. It will appear as the shape of the flower because the image has a transparent background. The gray background of the containing element will show through.

Exercises

Image Before you start designing graphics for an important business site, sketch out on a piece of paper the general size and shape of the graphical elements that you might want to include. Refer to the beginning of this hour for information about typical graphic sizes and screen resolutions, to ensure the best fit.

Image Using your graphics software program of choice, create a few simple animated graphics for placement on your website. Even if you put together only a few frames, you’ll have the opportunity to practice putting frames together to achieve the best frame rate for display.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.161.251