INFS 2150 / 7150 Intro to Web Development / HTML Programming

Similar documents
Chapter 5 Images. Presented by Thomas Powell. Slides adopted from HTML & XHTML: The Complete Reference, 4th Edition 2003 Thomas A.

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) Horizontal Rule Element

Web Development & Design Foundations with XHTML. Chapter 4 Key Concepts

Working with Images and Multimedia

Page Content. Inserting Text To add text to your document, you can type the text directly or use Cut or Copy and Paste or Paste Special.

HTML/XML. XHTML Authoring

Creating Web Pages with SeaMonkey Composer

Chapter 2 Creating and Editing a Web Page

More HTML. Images and links. Tables and lists. <h1>running in the family</h1> <h2>tonight 9pm BBC One</h2>

1/27/2013. Outline. Adding images to your site. Images and Objects INTRODUCTION TO WEB DEVELOPMENT AND HTML

Web Development & Design Foundations with HTML5

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

ClipArt and Image Files

HTML Exercise 20 Linking Pictures To Other Documents Or Web Sites

Welcome. Web Authoring: HTML - Advanced Topics & Photo Optimisation (Level 3) Richard Hey & Barny Baggs

Adobe Photoshop CS2 Reference Guide For Windows

Tutorial 3: Working with Cascading Style Sheets

Image Optimisation. Image Dimensions...1 Image File Formats...2 Adding Images...5 Thumbnails...13 Summary...15

Adobe Dreamweaver CS5/6: Learning the Tools

Chapter 4 A Hypertext Markup Language Primer

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 4 Test Bank

Create a Contact Sheet of Your Images Design a Picture Package Customize Your Picture Package Layout Resample Your Image...

Image Types Vector vs. Raster

Namma Kalvi.

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) More on Relative Linking. Learning Objectives (2 of 2)

Creating Web Pages Using Netscape Composer AGENDA FOR THIS WORKSHOP. 1. How does it all work? 2. What do I need to get started at Fairfield?

FrontPage. Directions & Reference

Web graphics. Introduction

INFS 2150 / 7150 Intro to Web Development / HTML Programming

Virus from hack - Original page

Creating and Building Websites

Frequently Asked Questions about Text and Graphics

Dreamweaver Basics. Planning your website Organize site structure Plan site design & navigation Gather your assets

IT153 Midterm Study Guide

1.6 Graphics Packages

Table of Contents. MySource Matrix Content Types Manual

INFS 2150 / 7150 Introduction to Web Development & HTML Programming

Rev. A 02/02/2016 Downers Grove Public Library Page 1 of 50

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Quick Guide for Photoshop CS 6 Advanced June 2012 Training:

Html basics Course Outline

More HTML. Graphics. Graphic Format

Final Study Guide Arts & Communications

Multimedia Systems. Part 4. Mahdi Vasighi

USER GUIDE. MADCAP FLARE 2018 r2. Images

Where to get Images.

Table Basics. The structure of an table

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

Cropping an Image for the Web

STD 7 th Paper 1 FA 4

Index. Smart Image Processor 2 Manual DMXzone.com

MS Publisher 2007: Graphics. Lesson Notes Author: Pamela Schmidt

GUIDELINES FOR WEB SITE DESIGN CHAPTER 10

Web Design, 5 th Edition

epromo Guidelines DUE DATES NOT ALLOWED PLAIN TEXT VERSION

HTML TIPS FOR DESIGNING.

Unit 8. Lesson 8.1. Microsoft FrontPage. Introduction. Microsoft FrontPage-1. Microsoft FrontPage

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Step 1 Download and Install KompoZer Step by step instructions to build your first web page using KompoZer web editor.

Centricity 2.0 Section Editor Help Card

Dreamweaver CS6. Level 3. Topics Working with Text, List, and tables Working with Images

Dazzle the Web with Dynamic Dreamweaver, Part II

The <img> Element. To place an image on our web page, we use the self-closing <img> element:

Eng 110, Spring Week 03 Lab02- Dreamwaver Session

Autodesk Moldflow Adviser AMA Reports

COMSC-031 Web Site Development- Part 2

GIMP GETTING STARTED

color bit depth dithered

Scientific Communication CITS4008. Designing and Writing Web Pages Rachel Cardell-Oliver 2013 Based on notes by Robyn Owens

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

Handout created by Cheryl Tice, Instructional Support for Technology, GST BOCES

frameset rows cols <frameset> rows cols

Welcome to Book Display Widgets

Interactive Multimedia. Multimedia and the World Wide Web

Fonts, text, and colour on the web. Sourcing, resizing, and inserting web site images MGMT 230 LAB

Ramani A.V 2 HEAD OF CS & SRMV CAS, Coimbatore, Tamilnadu, India

Creating Web Pages. Getting Started

Different File Types and their Use

Web Manager 2.0 User s Manual Table of Contents

Chapter 1 True/False Instructions: Circle T if the statement is true or F if the statement is false.

Module 5 The Applet Class, Swings. OOC 4 th Sem, B Div Prof. Mouna M. Naravani

Rich Text Editor Quick Reference

< building websites with dreamweaver mx >

Chapter 4: Marking Up With HTML: A Hypertext tmarkup Language Primer

Animating Layers with Timelines

5/17/2009. Marking Up with HTML. An HTML Web Page File. Tags for Bold, Italic, and underline. Structuring Documents

Using Graphics. Digital Camera. Auto Shapes

If these steps are not followed precisely as demonstrated in this tutorial, you will not be able to publish your site!

Index. Smart Image Processor PHP 2 Manual DMXzone.com

FLOATING AND POSITIONING

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Introduction to the Internet and World Wide Web p. 1 The Evolution of the Internet p. 2 The Internet, Intranets, and Extranets p. 3 The Evolution of

Objectives. Tutorial 8 Designing ga Web Site with Frames. Introducing Frames. Objectives. Disadvantages to Using Frames. Planning Your Frames

Understanding file formats

Tablet 300x x x x1024

Marking Up with HTML. Tags for Bold, Italic, and underline. An HTML Web Page File. Chapter 4: Marking Up With HTML: A. Formatting with Tags:

Develop great research posters using Microsoft PowerPoint

Transcription:

XP INFS 2150 / 7150 Intro to Web Development / HTML Programming Working with Graphics in a Web Page 1 Objectives Learn about different image formats Control the placement and appearance of images on a Web page Using the <img> tag and the attributes 2 1

Images and Image File Formats The two most commonly used image file formats in Web browsers are GIF and JPEG. Choosing the appropriate image format is an important part of Web page design. Balance the goal of creating an interesting and attractive page against the need to keep the size of your page small and easy to receive. Each file format has its advantages and disadvantages, and you will probably use a combination of both formats in your Web page designs. 3 Working with GIF Files GIF (Graphics Interchange Format) is the most commonly used image format on the Web. Compatible with virtually all browsers. GIF files are limited to displaying 256 colors. Often used for graphics requiring fewer colors, such as clip art images, line art, logos, and icons. Images that require more color depth, such as photographs, can appear grainy when saved as GIF files. 4 2

Interlaced and Non-interlaced GIFs Interlacing refers to the way the GIF is saved by the graphics software. Normally, with a noninterlaced GIF the image is saved one line at a time, starting from the top of the graphic and moving downward. With interlaced GIFs, the image is saved and retrieved stepwise. for example, every fifth line of the image might appear first, followed by every sixth line, and so forth through the remaining rows 5 Interlaced and Non-interlaced GIFs Interlacing is an effective format if you have a large graphic and want to give users a preview of the final image as it loads. Interlacing can increase the size of a GIF file by anywhere from 3 to 20 kilobytes, depending on the image. 6 3

Non-interlaced Graphic This figure shows how a noninterlaced GIF appears as it is slowly retrieved by the Web browser. If the graphic is large, it might take several minutes for the entire image to appear, which can frustrate the visitors to your Web page. top appears first Image appears one line at a time entire image is retrieved 7 Interlaced Graphic This figure shows the effect of interlacing, which is when the graphic starts out as a blurry representation of the final image, then gradually comes into focus-unlike the noninterlaced graphic, which is always a sharp image as it s being retrieved, although an incomplete one. a rough image appears first image starts to show more detail final image is crisp and detailed 8 4

Transparent GIFs A transparent color is a color from the image that is not displayed when the image is viewed in an application. In place of a transparent color, the browser will display whatever is on the page background. Creating a transparent color depends on the graphic software used. Many applications include the option to designate transparent color when saving the image i.e. PhotoShop. 9 A Transparent Image File This figure shows a transparent image file. the green background will be transparent when displayed in the browser logo background is transparent in the browser 5

Animated GIFs One of the most popular uses of GIFs is to create animated images. Animated GIFs are easy to create and smaller in size. An animated GIF is composed of several images that are displayed one after the other in rapid succession. Animated GIFs are an effective way to compose slide shows or to simulate motion. The newer standard includes enhancements such as interlacing, transparent colors, and animation. 11 Animated GIF Programs This figure shows a list of programs available on the Web that you can use to create your own animated GIFs. 6

Animated GIF Collections If you don t want to take the time to create your own animated GIFs, many animated GIF collections are available on the Web. This figure shows a list of a few of them. Animated GIFs continued Animated GIF files are typically larger than static GIF images. The use of animated GIFs can greatly increase the size of a Web page. Be careful not to overwhelm the user with animated images. Animated GIFs are limited to 256 colors and can use transparent colors. Early browser versions may not support animated GIFs. 14 7

Portable Network Graphics (PNG) A new file format called PNG (Portable Network Graphics) was created, and was promoted to take the place of GIF. PNG files use a free and open file format and can display more colors than GIFs. PNGs cannot be used for animated graphics. PNGs do allow transparent colors, but not all browsers support this feature. The PNG format may eventually replace GIFs, however GIFs continue to be very popular. 15 BMP, XPM, and XBM Images and Browsers Browsers can also display graphic files in many different formats BMP, XPM, XBM. BMP bit map format is a raw format: no compression applied; hence very large, and therefore slow in performance. Be aware when using other strange formats, the image might not be viewable in all browsers or browser versions. 16 8

Working with JPEG Files JPEG (Joint Photographic Experts Group) format creates graphics that use the full 16.7 million colors available in the color palette. JPEG files are most often used for photographs and images that cover a wide spectrum of color. JPEG files usually are smaller than GIF files. A JPEG file size can by controlled by the degree of image compression applied to the file. A JPEG file commonly uses file name extension -.JPEG or -.JPG. 17 Working with JPEG Files You cannot use transparent colors or animation with JPEG files. A JPEG format called progressive JPEG does now allow JPEG files to be interlaced. Not all design applications and Web browsers support progressive JPEGs. 18 9

The Effects of Compression on JPEG File Size and Quality This figure shows the effect of compression on a JPEG file. The increased compression cuts the file size to onetenth that of the original. The resulting image is less well-defined than the image with low compression. minimal compression: file size = 84.3 KB medium compression: file size = 14.2 KB moderate compression: file size = 20.7 KB heavy compression: file size = 8.6 KB An Inline Image If an image appears blurry or grainy, it could be because your monitor is capable of displaying only 256 colors, and not the full palette of 16.7 million colors. 10

Image Size and Placement We use the <img> tag to display an image from an image file; the attributes of the <img> tag allows us to control the image size and placement for display... 21 Attributes of the <img> Tag <img src= image file alt= text description height=# pixels width=# pixels hspace=# pixels vspace=# pixels border=# pixels bordercolor=color align= top middle bottom left right /> will make the image into a floating object for in-line text processing. NOTE: align = left or right 22 11

Controlling Image Alignment The align attribute can control the alignment of an image with the <img> tag. The syntax for the align attribute is: <img src= URL align= alignment > URL is the location and filename of the graphic file alignment indicates how you want the graphic aligned in relation to the surrounding text 23 Alignment Options This figure describes the possible values of the align attribute. align= absbottom Description Aligns the bottom of the object with the absolute bottom of the surrounding text. The absolute bottom is equal to the baseline of the text minus the height of the largest descender in the text. absmiddle Aligns the middle of the object with the middle of the surrounding text. The absolute middle is the midpoint between the absolute bottom and text top of the surrounding text. baseline bottom left middle right Aligns the bottom of the object with the baseline of the surrounding text. Aligns the bottom of the object with the bottom of the surrounding text. The bottom is equal to the baseline minus the standard height of a descender in the text. Aligns the object to the left of the surrounding text. All preceding and subsequent text flows to the right of the object. Aligns the middle of the object with the surrounding text. Aligns the object to the right of the surrounding text. All subsequent text flows to the left of the object. texttop top Aligns the top of the object with the absolute top of the surrounding text. The absolute top is the baseline plus the height of the largest ascender in the text. Aligns the top of the object with the top of the text. The top of the text is the baseline plus the standard height of an ascender in the text. 24 12

Effects of the Align Attribute This figure shows the effect of each alignment options on text surrounding the image. align = bottom align = middle align = top align = left align = right style= float: instead of align Instead of using the align= attribute, we may also use CSS style specification to specify how the image should be presented in HTML <img align= right > <img style= float:right; > Both work the same way: the image becomes floating graphics to be inserted to the right with text wrapped around. The same for left side: <img align= left > <img style= float:left; > 26 13

Clearing of Floating Graphic Since the HTML does not know the size of the floating graphic (on left, right, or both sides) it is necessary to use a line break with specification to clear beyond the floating graphic, if any. Note the use of clear= attribute in <br> tag, and the function equivalent use of CSS style. <br clear= right /> <br style= clear: right; /> It also works with floating graphic on left side, or on both sides, specifying left or both respectively instead of right. 27 Vertical and Horizontal Space To increase the horizontal and vertical space around an image use the hspace and vspace attributes. The syntax is: <img src= URL vspace= value hspace= value > hspace (horizontal space) attribute indicates the amount of space to the left and right of the image. vspace (vertical space) attribute controls the amount of space above and below the image 28 14

Using the hspace and vspace Attributes set the horizontal space around the graphic to 15 pixels and the vertical space to 5 pixels Controlling Image Size Another set of attributes for the <img> tag are the height and width attributes. Height and width attributes instruct the browser to display an image at a specific size. The height and width attributes can be used to increase or decrease the size of the image on a Web page. The syntax for setting the height and width attributes is: <img src= URL height= value width= value > value is the height and width of the image either in pixels or as a percentage of the page s height and width 30 15

Controlling Image Size To decrease the size of an image, use an image editing application to reduce the file size and dimensions of the image. Changing the size of the image within the <img> tag does not affect the file size, it makes the image look smaller improving the performance of the Web page. When a browser encounters an inline image, it calculates the image size and then uses this information to format the page. If the dimension is included with an image, the browser displays the image faster. 31 Using the alt Attribute The alt attribute specifies text to display in place of an inline image. The syntax for specifying alternate text is: <img src= URL alt= alternate text > 32 16

Specifying Alternative Text for an Inline Image Alternate image text is important because it allows users who have nongraphical browsers to know the content of your graphics. Alternate image text also appears as a placeholder for the graphic while the page is loading. This can be particularly important for users accessing your page through a slow dial up connection. specifying alternative text for an inline image 33 General Tips on Working with Color and Images The primary purpose of a Web page is to convey information. If an image adds visual interest to the Web page, include it. Be aware that overusing graphics can make a Web page difficult to read and cumbersome to display. 34 17

Reduce the Size of Web Pages Strive to make your Web page quick and easy to retrieve. The total size of an image on a Web page should be no more than 40 to 50 kilobyte. There are several ways to achieve this: use an image editing application experiment with different graphic format types use thumbnails-reduced versions of your images reuse images provide an alternate, text-only version of the Web page 35 Manage Your Colors Color can add a lot to a Web page, it can also detract from it. Make sure to have enough contrast between the text and background. do not place dark text on a dark background do not place light text on a light background Color is handled differently on different browsers test Web pages on different browsers and monitors 36 18

Summary Common image formats: GIF, JPG Using the <img> tag Controlling size and placement of images. How to align text with images. 37 19