Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Mastering the Internet and HTML Images and Image Tags.

Similar presentations


Presentation on theme: "1 Mastering the Internet and HTML Images and Image Tags."— Presentation transcript:

1 1 Mastering the Internet and HTML Images and Image Tags

2 2 Outline Goal Objectives Introduction Image formats Image software Image tags Creating images Editing images Capturing images Scaling images Image hyperlinks Multiple use of images Image list items GIF Animation Tiling Tutorials FAQs Summary Exercises/Homework

3 3 Goal This chapter covers images, their use in Web pages, their formats, and their tags. It also covers how to deal with images such as creation, editing, capture, and scaling

4 4 Objectives Introduction Image formats Image software Dealing with images (creation, editing, capturing, scaling, hyperlinks, multiple use, and list items) GIF animation Tiling

5 5 Introduction Images, icons, and logos enhance Web page design Images are best viewed or downloaded using broadband Internet connections. Larger images take longer to download Web authors can create images, scan them, or link to them If used in Web pages, images should be small (thumbnails) and simple

6 6 Image formats Image resolution and format affects its file size. Higher resolution produces larger size Three image formats are widely supported by the Web. They are GIF, JPEG (JPG), and PNG The GIF format supports the most commonly used 256 (8-bit) colors; the JPEG format supports the 16.7 million (24-bit) colors Use the GIF format for simple images created via image programs. Use the JPEG format for complex high-quality images created via scanning real photos, or digital photos

7 7 Image software Images can be created via drawing, scanning, or digital cameras Image creation and editing include Adobe Photoshop, Adobe Illustrator, Mapedit, Paint Shop Pro, ThumbsPlus, and WebImage Image software is 2D. Its coordinate system has an origin in the top left corner of the drawing window (figure 10.1) Inage viewing software allows viewing large libraries of images. Samples are CompuPic, Lview Pro, ViewSafe, and SnapShot

8 8 Figure 10.1 Image creation coordinate system

9 9 Image tags The tag, with its attributes, provides Web authors with the control they need to deal with images The attributes of the tag are SRC, ALT, BORDER, WIDTH, HEIGHT, ALIGN, HSPACE, VSPACE, USEMAP, LONGDESC, and ISMAP

10 10 Creating images Many image software exists MS Windows Paint program (figure 10.2) comes installed with Windows OS To access Paint, click: Start (menu on bottom left corner of desktop) => Programs => Accessories => Paint The Paint GUI is simple to use and intuitive (Cont’d)

11 11 Figure 10.2 MS Windows Paint program (Cont’d)

12 12 Creating images Example 10.1 Image in a Web page (figure 10.3) A Web page with images Web page with a simple image <IMG SRC = "myImage.GIF" ALT = "A GIF image drawn in Paint“ BORDER = 5 ALIGN = "middle“ HSPACE = 10 VSPACE = 15>Text aligned middle This text is placed 15 pixels below the image

13 13 Editing and capturing images Image editing may mean changing image content (cropping it or adding graphics/colors/text), or changing its size (compressing (encoding) or decompressing (decoding) it) GIF compression maintains the image original colors, while JPEG compression reduces the number of colors Web authors should not compress and then decompress JPEG images more than once To capture and save an image off the Web, right click on it and follow prompts

14 14 Scaling images The WIDTH and HEIGHT attributes of the tag are used to scale images Example 10.2 Scaling images (Fig. 10.4) A Web page with scaled images Web page with a scaled image <IMG SRC = "myImage.GIF“ ALT = "A GIF image drawn in Paint“ BORDER = 5 ALIGN = "middle" HSPACE = 10 VSPACE = 15 WIDTH=100 HEIGHT=125>Text aligned middle This text is placed 15 pixels below the image Figure 10.4 Scaling an image

15 15 Image hyperlinks Images can be used, instead of text, as hyperlinks Example 10.3 Image hyperlinks (Fig. 10.5) A Web page with image hyperlink Web page with an image hyperlink <IMG SRC = "myImage.GIF" ALT = "A GIF image drawn in Paint" ALIGN = "middle" HSPACE = 10 VSPACE = 15 WIDTH = 40 HEIGHT = 50> Text aligned middle This text is placed 15 pixels below the image (Cont’d)

16 16 Figure 10.5 Image hyperlink

17 17 Multiple use of images The same image could be used more than once in the same Web page Example 10.4 Multiple use of an image (figure 10.6) (shortened from the top) <IMG SRC = "myImage.GIF" ALT = "A GIF image drawn in Paint" ALIGN = "middle" HSPACE = 10 VSPACE = 15 WIDTH = 40 HEIGHT = 50> Text aligned middle This text is placed 15 pixels below the image

18 18 Image list items Images can be used as list items or item hyperlinks in unordered, ordered, or definition lists Example 10.5 Image list items (Figure 10.7) A Web page with image list items Web page with image list items This is the original image Image list item An image may be used as a list item in unordered, ordered, or definition lists. This is an image hyperlink as a list item. (Cont’d)

19 19 Figure 10.7 Image list items

20 20 GIF animation GIF animation allows a Web author to create a set of image frames in the desired sequence and save them in one GIF file, as shown below in figure 10.8 Figure 10.8 Animation sequence of a ball

21 21 Tiling When a Web author uses an image as a page background, the browser repeats it horizontally and vertically in a pattern, thus creating a tiling effect Example 10.6 Tiling a Web page A Web page with tiling Web page with tiling This is the original image Image list item An image may be used as a list item in unordered, ordered, or definition lists. This is an image hyperlink as a list item. (Figure 10.9)

22 22 Figure 10.9 Tiling a Web page

23 23 Tutorials Tutorial 10.6.1 Right justify an image (top tags are not shown) This is an image that is right- justified relative to this text. It seems that the right and left justifications are more practical than the vertical (top, middle, or bottom) justification. Yet, a better way of formatting Web pages is to use tables. Yes, HTML uses tables to format Web pages very precisely. More on tables later. As you can see in this screen capture, the text flows underneath the image as we expect.

24 24 FAQs Q: Why is the browser not displaying the image in my Web page? – A: The reason is usually unintentional misuse of the tag. Quite often a Web author forgets to close the quotes in the tag; for example,. Check the tag carefully and ensure that its syntax is correct. (Cont’d)

25 25 FAQs Q: How can I control the positioning of text around an image in my Web page? – A: Positioning of text around images in Web pages cannot be controlled without using tables to format the page, as discussed in chapter 16 of this book. Without tables, Web authors can use the ALIGN attribute which aligns text as shown in figures 10.4 and 10.5.

26 26 Summary – Images enhance Web page design and presentation – Images are best used with broadband connections – Image variables are resolution and format – Web image formats are GIF, JPEG (JPG), and PNG – Use GIF format for simple images, and JPEG format for complex images (e.g. photos and scanned pictures) – The HTML image tag is. Its attributes are SRC, ALT, BORDER, WIDTH, HEIGHT, ALIGN, HSPACE, VSPACE, USEMAP, LONGDESC, and ISMAP – Images can be created, edited, compressed, captured, scaled, animated, and/or used as hyperlinks or list items

27 27 Exercises Problem 10.3. Use two images in a Web page.Use the first image as is, and scale the second one down by 50%. Use the ALT, BORDER, WIDTH, HEIGHT, ALIGN, HSPACE, and VSPACE attributes of the tag. – Solution strategy: Follow examples 10.1 and 10.2. Use a text editor to write and debug the HTML code. Use a browser to display the results (Cont’d)

28 28 A Web page with scaled images Web page with a scaled image Text aligned middle This text is placed 15 pixels below the image Text aligned middle This text is placed 15 pixels below the image (Cont’d)

29 29

30 30 Problems Problem 10.15 Create a Web page that uses an image for a tiling effect. Choose your favorite image for tiling. You could draw it or download it. – Solution strategy: Follow example 10.6. Use a text editor to write the HTML code. Use a browser to test it (Cont’d)

31 31 A Web page with tiling Web page with tiling This is the original image Image list item An image may be used as a list item in unordered, ordered, or definition lists. <IMG SRC = "myDog3.jpg" ALT = "My dog Lucy" ALIGN = "middle" HSPACE = 10 VSPACE = 15 WIDTH = 100 HEIGHT = 70> This is an image hyperlink as a list item. (Cont’d)

32 32


Download ppt "1 Mastering the Internet and HTML Images and Image Tags."

Similar presentations


Ads by Google