SlideShare a Scribd company logo
Principles of Web Design
5th Edition
Chapter Eight
Graphics and Color
Objectives
When you complete this chapter, you will be able to:
• Understand graphic file formats
• Choose a graphics tool
• Use the <img> element
• Control image properties with CSS
• Understand computer color basics
• Control color properties with CSS
• Control background images with CSS
2
Principles of Web Design 5th Ed.
Understanding Graphic File
Formats
• You can currently use only three image file
formats on the Web: GIF, JPG, and PNG
– A newer format, SVG, has had limited success
• These formats all compress images to create
smaller files
– Knowing which file format to use for which type of
image is important
• If you choose the wrong file type, your image
won’t compress or display properly
Principles of Web Design 5th Ed. 3
4
GIF
• GIF uses a lossless compression
technique, meaning that no color
information is discarded when the image is
compressed
• The color depth of GIF is 8-bit, allowing a
palette of no more than 256 colors
• GIF excels at compressing and displaying
flat color areas, making it the logical choice
for line art and color graphics
Principles of Web Design 5th Ed.
5
GIF Transparency
• With GIF files, you can choose any one color
in an image to appear as transparent in the
browser
• The background color or pattern will show
through the areas that you have designated
as transparent
• Using transparent areas allows you to create
graphics that appear to have an irregular
outside shape, rather than being bounded by
a rectangle
Principles of Web Design 5th Ed.
6
Principles of Web Design 5th Ed.
7
GIF Animation
• The GIF format lets you store multiple images
and timing information about the images in a
single file
• This means that you can build animations
consisting of multiple static images that play
continuously, creating the illusion of motion
Principles of Web Design 5th Ed.
8
Principles of Web Design 5th Ed.
9
JPG
• JPG is best for photographs or continuous
tone images
• JPGs are 24-bit RGB images that allow
millions of colors
• JPGs use a “lossy” compression routine
especially designed for photographic
images
– When the image is compressed, some color
information is discarded, resulting in a loss of
quality from the original image
Principles of Web Design 5th Ed.
10
JPG
• When you create the JPG file, you can also
manually balance the amount of compression
versus the resulting image quality
• The higher the compression, the lower the
image quality
– You can play with this setting to create files that
are as small as possible but still look good
• Many photos can sustain quite a bit of
compression while still maintaining image
integrity
Principles of Web Design 5th Ed.
11
Principles of Web Design 5th Ed.
12
PNG
• A royalty-free file format that is intended to
replace GIF
• This lossless format compresses bit
images to smaller file sizes than GIF
• PNG supports transparency and interlacing
but not animation
Principles of Web Design 5th Ed.
13
SVG
• A language for describing two-dimensional
graphics using XML
• SVG graphics are scalable to different
display resolutions and are printable
• Most new browsers now support SVG
Principles of Web Design 5th Ed.
14
Using Interlacing & Progressive
Display
• These are the gradual display of a graphic in a
series of passes as the data arrives in the browser
• Most Web-capable graphics editors let you save
images in an interlaced or progressive format
• You can choose this display option when creating
GIF, PNG, and JPG files
• GIF and PNG files use interlacing, while JPGs use
progression
Principles of Web Design 5th Ed.
Principles of Web Design, 4th Edition
15
16
Where You Can Find Images
• Stock photo collections
• Digital cameras
• Scanner
• Public-domain Web sites
• Clip art
• Create your own
• Remember to respect copyright laws!
Principles of Web Design 5th Ed.
17
Choosing the Right Format
• GIF: the everyday file format for all types of
simple colored graphics and line art
– GIF’s transparency feature lets you seamlessly
integrate graphics into your Web site
• JPG: use JPG for all 24-bit full color
photographic images, as well as more
complicated graphics that contain color
gradients, shadows, and feathering
Principles of Web Design 5th Ed.
18
Choosing the Right Format
• PNG: you can use PNG as a substitute for
GIF
• SVG: offers many advantages, wait for
complete browser support
Principles of Web Design 5th Ed.
Choosing a Graphics Tool
Principles of Web Design 5th Ed. 19
• You use graphics software to create or manipulate
graphics
• Look for a tool that meets your needs and will not
take a long time to learn
• Shareware and freeware software are available
20
Using the Image Element
• <img> is a replaced element
• <img> is an empty element, so never use a
closing tag with it
Principles of Web Design 5th Ed.
21
Using the Image Element
• Normal image alignment is to the baseline
of the text
• Images that are within a line of text must
have spaces on both sides, or the text will
touch the image
Principles of Web Design 5th Ed.
22
<img> Element Attributes
Principles of Web Design 5th Ed.
23
Replacing Element Attributes with
Style Sheet Properties
Principles of Web Design 5th Ed.
24
Specifying alt and title Attribute Text
• The alt text is displayed if the image does
not appear, providing a description of the
image
• The title text appears as a pop-up when
the user places the cursor over the image
Principles of Web Design 5th Ed.
25
Principles of Web Design 5th Ed.
26
<img src="balloons_sm.jpg" width="200" height="267"
alt="Hot Air Balloon image" title="Balloons at the
Great Falls Festival in Lewiston, Maine"/>
Principles of Web Design 5th Ed.
27
Specifying Image Width and Height
• Every <img> element on your site should
contain width and height attributes
• These attributes provide important information
to the browser by specifying the amount of
space to reserve for the image
• This information dramatically affects the way
your pages download to the user, especially at
slower connection speeds
Principles of Web Design 5th Ed.
28
Principles of Web Design 5th Ed.
29
Principles of Web Design 5th Ed.
Sizing Graphics for the Page
• Size graphics appropriately
• Keep their dimensions small and appropriate to the
size of the page
Principles of Web Design 5th Ed. 30
31
Principles of Web Design 5th Ed.
32
Controlling Image Properties with CSS
• Removing the hypertext border
• Aligning text and images
• Floating images
• Adding white space around images
Principles of Web Design 5th Ed.
33
Removing the Hypertext Border
from an Image
• When you create a hypertext image, the
browser’s default behavior is to display the
hypertext border around the image
• This border is often unnecessary as users
often use their mouse to point to each
image to see if the hypertext cursor
displays
<img src="balloon.jpg" width="100"
height="100" alt="balloon”
style="border: none" />
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 34
35
Aligning Text and Images
• You can align text along an image border
using the align attribute
• Text and image alignment defaults to
bottom alignment, which means the bottom
of the text aligns with the bottom edge of
the image
• Valid values are: top, middle, bottom, left,
right
Principles of Web Design 5th Ed.
36
Principles of Web Design 5th Ed.
37
Floating Images
• The float property can be used to float an
image to the left or right of text
• The following style rules create two
classes of <img> elements, one of which
floats to the left of text; the other floats to
the right
img.left {float:left;}
img.right {float:right;}
Principles of Web Design 5th Ed.
38
Principles of Web Design 5th Ed.
39
Adding White Space around Images
• Add white space around your images to
reduce clutter and improve readability
• Use the CSS margin property to increase
the white space around an image
Principles of Web Design 5th Ed.
40
Principles of Web Design 5th Ed.
41
Understanding Computer
Color Basics
• Monitors display colors by mixing three basic
colors of light: red, green, and blue
– Intensity ranges from:
• 0% (complete absence of color) to 100% (complete presence
of color)
• Color depth
– Amount of data used to create the color
• bit (256 colors), 16-bit, and 24-bit (16.7M colors)
Principles of Web Design 5th Ed.
42
Color Depth
• The amount of data used to create color on a
display is called the color depth
• If your users have a 24-bit color display, they
can appreciate the full-color depth of your
images
• If your monitor doesn’t support the full color
depth of an image, the browser must resort to
mixing colors that attempt to match the
original colors in the image
Principles of Web Design 5th Ed.
43
Principles of Web Design 5th Ed.
44
Specifying CSS Color Values
• Color names
• RGB color values
• Hexadecimal color values
Principles of Web Design 5th Ed.
45
Using Color Names
• Sets color values using common color names
– Blue, gray, red, etc.
• Limited to small range of colors
• Not a very specific representation of color
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 46
47
Using RGB Color Values
• Numerical values that specify the blending of the
red, green, and blue color channels
• Range: 0-100% (zero color to max color)
– Also: 0-255 (integer)
• Can be expressed as percentage or integer:
P {color: rgb(0, 100%, 100%);}
or
P {color: rgb(0, 255, 255);}
Principles of Web Design 5th Ed.
48
Using Hexadecimal
Color Values
• Numerical values that specify the blending of the
red, green, and blue color channels
– Base 16 number system (0-9, A-F)
• Range: 00-FF (zero color to max color)
– Example: Red  FF 00 00
– The following rules specify the same color:
P {color: #00FFFF;}
P {color: rgb(0, 100%, 100%);}
P {color: rgb(0, 255, 255);}
Principles of Web Design 5th Ed.
49
Understanding Element Layers
• Background color layer—the backmost layer,
specified by the background-color property
• Background image layer—the middle layer,
specified by the background-image property
• Content layer—the frontmost layer; this is the
color of the text content; specified by the color
property
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 50
51
Controlling Color Properties
with CSS
• Specifying color values
• Setting default text color
• Changing link colors
• Specifying background color
• Setting the page background color
• Creating a text reverse
Principles of Web Design 5th Ed.
52
Specifying Color Values
/* color name */
p {color: blue;}
/* hexadecimal value */
p {color: #0000ff;}
/* RGB numbers */
p {color: rgb(0,0,255);}
/* RGB percentages */
p {color: rgb(0%,0%,100%);}
The following style rules show the different
methods of specifying a color:
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 53
54
Changing Link Colors
• You can change the colors of hypertext links by
using the following special CSS classes
• link—the unvisited link color
• active—the active link color; this is the color
displayed when the user points to a link and
holds down the mouse button
• visited—the visited link color
Principles of Web Design 5th Ed.
55
Changing Link Colors
• You can use these special classes only with the
<a> tag
• The syntax uses a colon (:) flag character as
shown in the following examples:
a:link {color: #000000;} /* new links are black */
a:active {color: #FF0000;} /* active links are red */
a:visited {color: #CCCCCC;} /* visited links are gray */
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 56
57
Specifying Background Colors
• Background-color
– Sets the background color of any element on a
Web page (including padding area)
– By default, background color of any element is
transparent
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 58
Setting Page Background Color
• To set the page background color, use body as the
selector
• The following rule sets a background color for the
<body> element
body {background-color: #c5f0ff;}
Principles of Web Design 5th Ed. 59
Principles of Web Design 5th Ed. 60
61
Creating a Text Reverse
• The background and foreground colors are
reversed
• The following rule sets the text color to
white and the background color to blue:
h1 { color: #fff;
padding: .25em;
background-color: #f90000;
}
Principles of Web Design 5th Ed.
62
Principles of Web Design 5th Ed.
Controlling Background Images
with CSS
Specifying a Background Image
• The background-image property lets you
specify which image to display
• Other CSS background properties control how
the image is displayed
64
Principles of Web Design 5th Ed. 65
Principles of Web Design 5th Ed. 66
Creating a Page Background
• To tile an image across the entire background of
the Web page, use body as the selector
body {background-image: url(clouds.jpg);}
Principles of Web Design 5th Ed. 67
68
Creating an Element Background
h1 {background-image: url(bluetex.jpg); padding: .25em;}
• Images can be applied to the background of
any element
• The following rule applies an image to the
background of the H1 element:
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 69
70
Specifying Background Repeat
• Controls tiling of background images
body {
background-image: url(grayivy.jpg);
background-repeat: repeat-y;
}
Principles of Web Design 5th Ed.
71
• Allows creation of a vertically repeating background
graphic
body {
background-image: url(column.jpg);
background-repeat: repeat-y;
}
Creating a Vertical Repeat
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 72
73
Creating a Horizontal Repeat
• Allows creation of a horizontally repeating
background graphic
body {
background-image:
url(header.jpg);
background-repeat: repeat-x;
}
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 74
75
Creating a Nonrepeating
Background Image
• Allows creation of a single instance of an
image in the background
• The following style rule shows the use of the
no-repeat value:
body {
background-image:
url(balloon_sm.jpg);
background-repeat: no-repeat;
}
Principles of Web Design 5th Ed.
Principles of Web Design, 4th 76
Specifying Background Position
• The background-position property lets you use
three types of values: percentage, length, or
keywords
#right {
background-image:
url(rightgradient.gif);
background-repeat: repeat-y;
background-position: right;
}
Principles of Web Design 5th Ed. 77
78
Positioning Vertical and Horizontal
Background Images
• Positions images that repeat on either the
horizontal or vertical axis of the Web page
Principles of Web Design 5th Ed.
Principles of Web Design 5th Ed. 79
Summary
• The four popular file formats for the Web are GIF,
JPG, PNG, and SVG
• Your computer monitor displays color by mixing the
three basic colors of light: red, green, and blue
(RGB)
• Reduce image size to the appropriate dimensions
• The color scheme you choose for a Web site
should create a distinctive look without detracting
from your content’s legibility
Principles of Web Design 5th Ed. 80
Summary
• Use the color property to set foreground colors for
elements
• Background colors affect any padding areas in the
element
• Choose background images that do not detract
from the legibility of your content
• Test your work on different browsers and
computing platforms
Principles of Web Design 5th Ed. 81

More Related Content

Similar to 9781111528705_PPT_ch08.ppt

P1.1
P1.1P1.1
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5Jeff Byrnes
 
Portfolio Presentation Final
Portfolio Presentation FinalPortfolio Presentation Final
Portfolio Presentation FinalShea Hinds
 
Image optimization and you
Image optimization and youImage optimization and you
Image optimization and you
Johannes Siipola
 
Creating Images for the Web
Creating Images for the WebCreating Images for the Web
Creating Images for the Web
Shawn Calvert
 
Image file formats
Image file formatsImage file formats
Image file formats
KarlRubin
 
File Types Pro Forma
File Types Pro FormaFile Types Pro Forma
File Types Pro Forma
jessstanton17
 
Design for Non-Designers: An Introduction to Design for Nonprofits
Design for Non-Designers: An Introduction to Design for NonprofitsDesign for Non-Designers: An Introduction to Design for Nonprofits
Design for Non-Designers: An Introduction to Design for Nonprofits
NetSquared Vancouver
 
Optimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEOOptimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEO
Steve Mortiboy
 
Practical information for images in ebooks - ebookcraft 2015 - Joshua Tallent
Practical information for images in ebooks - ebookcraft 2015 - Joshua TallentPractical information for images in ebooks - ebookcraft 2015 - Joshua Tallent
Practical information for images in ebooks - ebookcraft 2015 - Joshua Tallent
BookNet Canada
 
Presentación info
Presentación infoPresentación info
Presentación info
Irene Valera
 
JAY MARK( Group 8).pptx
JAY MARK( Group 8).pptxJAY MARK( Group 8).pptx
JAY MARK( Group 8).pptx
JAYMARKRAPISTA
 
Raster vs vector
Raster vs vectorRaster vs vector
Raster vs vector
akn4fotos
 
Presentation on images
Presentation on imagesPresentation on images
Presentation on images
umme farwa
 
Week 6 Task File Formats
Week 6 Task   File FormatsWeek 6 Task   File Formats
Week 6 Task File Formatsguest2cf876
 
Image Optimization
Image OptimizationImage Optimization
Image Optimization
Tasawr Interactive
 

Similar to 9781111528705_PPT_ch08.ppt (20)

Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
P1.1
P1.1P1.1
P1.1
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5
 
Portfolio Presentation Final
Portfolio Presentation FinalPortfolio Presentation Final
Portfolio Presentation Final
 
Image optimization and you
Image optimization and youImage optimization and you
Image optimization and you
 
Portfolio Task 5
Portfolio Task 5Portfolio Task 5
Portfolio Task 5
 
Portfolio T
Portfolio TPortfolio T
Portfolio T
 
Portfolio Task 5
Portfolio Task 5Portfolio Task 5
Portfolio Task 5
 
Creating Images for the Web
Creating Images for the WebCreating Images for the Web
Creating Images for the Web
 
Image file formats
Image file formatsImage file formats
Image file formats
 
File Types Pro Forma
File Types Pro FormaFile Types Pro Forma
File Types Pro Forma
 
Design for Non-Designers: An Introduction to Design for Nonprofits
Design for Non-Designers: An Introduction to Design for NonprofitsDesign for Non-Designers: An Introduction to Design for Nonprofits
Design for Non-Designers: An Introduction to Design for Nonprofits
 
Optimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEOOptimizing images in WordPress to improve site performance and sSEO
Optimizing images in WordPress to improve site performance and sSEO
 
Practical information for images in ebooks - ebookcraft 2015 - Joshua Tallent
Practical information for images in ebooks - ebookcraft 2015 - Joshua TallentPractical information for images in ebooks - ebookcraft 2015 - Joshua Tallent
Practical information for images in ebooks - ebookcraft 2015 - Joshua Tallent
 
Presentación info
Presentación infoPresentación info
Presentación info
 
JAY MARK( Group 8).pptx
JAY MARK( Group 8).pptxJAY MARK( Group 8).pptx
JAY MARK( Group 8).pptx
 
Raster vs vector
Raster vs vectorRaster vs vector
Raster vs vector
 
Presentation on images
Presentation on imagesPresentation on images
Presentation on images
 
Week 6 Task File Formats
Week 6 Task   File FormatsWeek 6 Task   File Formats
Week 6 Task File Formats
 
Image Optimization
Image OptimizationImage Optimization
Image Optimization
 

More from SimonChirambira

9781111528705_PPT_ch03.ppt
9781111528705_PPT_ch03.ppt9781111528705_PPT_ch03.ppt
9781111528705_PPT_ch03.ppt
SimonChirambira
 
9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt
SimonChirambira
 
9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt
SimonChirambira
 
9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt
SimonChirambira
 
9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt
SimonChirambira
 
9781111528705_PPT_ch05.ppt
9781111528705_PPT_ch05.ppt9781111528705_PPT_ch05.ppt
9781111528705_PPT_ch05.ppt
SimonChirambira
 
9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx
SimonChirambira
 
9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx
SimonChirambira
 
9781111528705_PPT_ch10.ppt
9781111528705_PPT_ch10.ppt9781111528705_PPT_ch10.ppt
9781111528705_PPT_ch10.ppt
SimonChirambira
 
9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx
SimonChirambira
 
9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx
SimonChirambira
 

More from SimonChirambira (11)

9781111528705_PPT_ch03.ppt
9781111528705_PPT_ch03.ppt9781111528705_PPT_ch03.ppt
9781111528705_PPT_ch03.ppt
 
9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt9781111528705_PPT_ch07.ppt
9781111528705_PPT_ch07.ppt
 
9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt9781111528705_PPT_ch09.ppt
9781111528705_PPT_ch09.ppt
 
9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt
 
9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt
 
9781111528705_PPT_ch05.ppt
9781111528705_PPT_ch05.ppt9781111528705_PPT_ch05.ppt
9781111528705_PPT_ch05.ppt
 
9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx9781111528705_PPT_ch012.pptx
9781111528705_PPT_ch012.pptx
 
9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx9781111528705_PPT_ch013.pptx
9781111528705_PPT_ch013.pptx
 
9781111528705_PPT_ch10.ppt
9781111528705_PPT_ch10.ppt9781111528705_PPT_ch10.ppt
9781111528705_PPT_ch10.ppt
 
9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx9781111528705_PPT_ch014.pptx
9781111528705_PPT_ch014.pptx
 
9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx9781111528705_PPT_ch01.pptx
9781111528705_PPT_ch01.pptx
 

Recently uploaded

Exploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdfExploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdf
fastfixgaragedoor
 
vernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdfvernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdf
PrabhjeetSingh219035
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Mansi Shah
 
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
9a93xvy
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
ameli25062005
 
Research 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdfResearch 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdf
ameli25062005
 
一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理
一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理
一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理
jyz59f4j
 
Book Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for DesignersBook Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for Designers
Confidence Ago
 
projectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdfprojectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdf
farazahmadas6
 
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
7sd8fier
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
cy0krjxt
 
Let's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons ShirtLet's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons Shirt
TeeFusion
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
n0tivyq
 
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
taqyed
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
Alan Dix
 
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
7sd8fier
 
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
708pb191
 
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
h7j5io0
 
Transforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting ProfitabilityTransforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting Profitability
aaryangarg12
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
7sd8fier
 

Recently uploaded (20)

Exploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdfExploring the Future of Smart Garages.pdf
Exploring the Future of Smart Garages.pdf
 
vernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdfvernacular architecture in response to climate.pdf
vernacular architecture in response to climate.pdf
 
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
Between Filth and Fortune- Urban Cattle Foraging Realities by Devi S Nair, An...
 
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
一比一原版(CITY毕业证书)谢菲尔德哈勒姆大学毕业证如何办理
 
20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf20 slides of research movie and artists .pdf
20 slides of research movie and artists .pdf
 
Research 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdfResearch 20 slides Amelia gavryliuks.pdf
Research 20 slides Amelia gavryliuks.pdf
 
一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理
一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理
一比一原版(LSE毕业证书)伦敦政治经济学院毕业证成绩单如何办理
 
Book Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for DesignersBook Formatting: Quality Control Checks for Designers
Book Formatting: Quality Control Checks for Designers
 
projectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdfprojectreportnew-170307082323 nnnnnn(1).pdf
projectreportnew-170307082323 nnnnnn(1).pdf
 
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
一比一原版(MMU毕业证书)曼彻斯特城市大学毕业证成绩单如何办理
 
Design Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinkingDesign Thinking Design thinking Design thinking
Design Thinking Design thinking Design thinking
 
Let's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons ShirtLet's Summon Demons Shirt Let's Summon Demons Shirt
Let's Summon Demons Shirt Let's Summon Demons Shirt
 
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
一比一原版(Glasgow毕业证书)格拉斯哥大学毕业证成绩单如何办理
 
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理一比一原版(毕业证)长崎大学毕业证成绩单如何办理
一比一原版(毕业证)长崎大学毕业证成绩单如何办理
 
Can AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI preludeCan AI do good? at 'offtheCanvas' India HCI prelude
Can AI do good? at 'offtheCanvas' India HCI prelude
 
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
一比一原版(NCL毕业证书)纽卡斯尔大学毕业证成绩单如何办理
 
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
一比一原版(UAL毕业证书)伦敦艺术大学毕业证成绩单如何办理
 
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
一比一原版(BU毕业证书)伯恩茅斯大学毕业证成绩单如何办理
 
Transforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting ProfitabilityTransforming Brand Perception and Boosting Profitability
Transforming Brand Perception and Boosting Profitability
 
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
一比一原版(UNUK毕业证书)诺丁汉大学毕业证如何办理
 

9781111528705_PPT_ch08.ppt

  • 1. Principles of Web Design 5th Edition Chapter Eight Graphics and Color
  • 2. Objectives When you complete this chapter, you will be able to: • Understand graphic file formats • Choose a graphics tool • Use the <img> element • Control image properties with CSS • Understand computer color basics • Control color properties with CSS • Control background images with CSS 2 Principles of Web Design 5th Ed.
  • 3. Understanding Graphic File Formats • You can currently use only three image file formats on the Web: GIF, JPG, and PNG – A newer format, SVG, has had limited success • These formats all compress images to create smaller files – Knowing which file format to use for which type of image is important • If you choose the wrong file type, your image won’t compress or display properly Principles of Web Design 5th Ed. 3
  • 4. 4 GIF • GIF uses a lossless compression technique, meaning that no color information is discarded when the image is compressed • The color depth of GIF is 8-bit, allowing a palette of no more than 256 colors • GIF excels at compressing and displaying flat color areas, making it the logical choice for line art and color graphics Principles of Web Design 5th Ed.
  • 5. 5 GIF Transparency • With GIF files, you can choose any one color in an image to appear as transparent in the browser • The background color or pattern will show through the areas that you have designated as transparent • Using transparent areas allows you to create graphics that appear to have an irregular outside shape, rather than being bounded by a rectangle Principles of Web Design 5th Ed.
  • 6. 6 Principles of Web Design 5th Ed.
  • 7. 7 GIF Animation • The GIF format lets you store multiple images and timing information about the images in a single file • This means that you can build animations consisting of multiple static images that play continuously, creating the illusion of motion Principles of Web Design 5th Ed.
  • 8. 8 Principles of Web Design 5th Ed.
  • 9. 9 JPG • JPG is best for photographs or continuous tone images • JPGs are 24-bit RGB images that allow millions of colors • JPGs use a “lossy” compression routine especially designed for photographic images – When the image is compressed, some color information is discarded, resulting in a loss of quality from the original image Principles of Web Design 5th Ed.
  • 10. 10 JPG • When you create the JPG file, you can also manually balance the amount of compression versus the resulting image quality • The higher the compression, the lower the image quality – You can play with this setting to create files that are as small as possible but still look good • Many photos can sustain quite a bit of compression while still maintaining image integrity Principles of Web Design 5th Ed.
  • 11. 11 Principles of Web Design 5th Ed.
  • 12. 12 PNG • A royalty-free file format that is intended to replace GIF • This lossless format compresses bit images to smaller file sizes than GIF • PNG supports transparency and interlacing but not animation Principles of Web Design 5th Ed.
  • 13. 13 SVG • A language for describing two-dimensional graphics using XML • SVG graphics are scalable to different display resolutions and are printable • Most new browsers now support SVG Principles of Web Design 5th Ed.
  • 14. 14 Using Interlacing & Progressive Display • These are the gradual display of a graphic in a series of passes as the data arrives in the browser • Most Web-capable graphics editors let you save images in an interlaced or progressive format • You can choose this display option when creating GIF, PNG, and JPG files • GIF and PNG files use interlacing, while JPGs use progression Principles of Web Design 5th Ed.
  • 15. Principles of Web Design, 4th Edition 15
  • 16. 16 Where You Can Find Images • Stock photo collections • Digital cameras • Scanner • Public-domain Web sites • Clip art • Create your own • Remember to respect copyright laws! Principles of Web Design 5th Ed.
  • 17. 17 Choosing the Right Format • GIF: the everyday file format for all types of simple colored graphics and line art – GIF’s transparency feature lets you seamlessly integrate graphics into your Web site • JPG: use JPG for all 24-bit full color photographic images, as well as more complicated graphics that contain color gradients, shadows, and feathering Principles of Web Design 5th Ed.
  • 18. 18 Choosing the Right Format • PNG: you can use PNG as a substitute for GIF • SVG: offers many advantages, wait for complete browser support Principles of Web Design 5th Ed.
  • 19. Choosing a Graphics Tool Principles of Web Design 5th Ed. 19 • You use graphics software to create or manipulate graphics • Look for a tool that meets your needs and will not take a long time to learn • Shareware and freeware software are available
  • 20. 20 Using the Image Element • <img> is a replaced element • <img> is an empty element, so never use a closing tag with it Principles of Web Design 5th Ed.
  • 21. 21 Using the Image Element • Normal image alignment is to the baseline of the text • Images that are within a line of text must have spaces on both sides, or the text will touch the image Principles of Web Design 5th Ed.
  • 22. 22 <img> Element Attributes Principles of Web Design 5th Ed.
  • 23. 23 Replacing Element Attributes with Style Sheet Properties Principles of Web Design 5th Ed.
  • 24. 24 Specifying alt and title Attribute Text • The alt text is displayed if the image does not appear, providing a description of the image • The title text appears as a pop-up when the user places the cursor over the image Principles of Web Design 5th Ed.
  • 25. 25 Principles of Web Design 5th Ed.
  • 26. 26 <img src="balloons_sm.jpg" width="200" height="267" alt="Hot Air Balloon image" title="Balloons at the Great Falls Festival in Lewiston, Maine"/> Principles of Web Design 5th Ed.
  • 27. 27 Specifying Image Width and Height • Every <img> element on your site should contain width and height attributes • These attributes provide important information to the browser by specifying the amount of space to reserve for the image • This information dramatically affects the way your pages download to the user, especially at slower connection speeds Principles of Web Design 5th Ed.
  • 28. 28 Principles of Web Design 5th Ed.
  • 29. 29 Principles of Web Design 5th Ed.
  • 30. Sizing Graphics for the Page • Size graphics appropriately • Keep their dimensions small and appropriate to the size of the page Principles of Web Design 5th Ed. 30
  • 31. 31 Principles of Web Design 5th Ed.
  • 32. 32 Controlling Image Properties with CSS • Removing the hypertext border • Aligning text and images • Floating images • Adding white space around images Principles of Web Design 5th Ed.
  • 33. 33 Removing the Hypertext Border from an Image • When you create a hypertext image, the browser’s default behavior is to display the hypertext border around the image • This border is often unnecessary as users often use their mouse to point to each image to see if the hypertext cursor displays <img src="balloon.jpg" width="100" height="100" alt="balloon” style="border: none" /> Principles of Web Design 5th Ed.
  • 34. Principles of Web Design 5th Ed. 34
  • 35. 35 Aligning Text and Images • You can align text along an image border using the align attribute • Text and image alignment defaults to bottom alignment, which means the bottom of the text aligns with the bottom edge of the image • Valid values are: top, middle, bottom, left, right Principles of Web Design 5th Ed.
  • 36. 36 Principles of Web Design 5th Ed.
  • 37. 37 Floating Images • The float property can be used to float an image to the left or right of text • The following style rules create two classes of <img> elements, one of which floats to the left of text; the other floats to the right img.left {float:left;} img.right {float:right;} Principles of Web Design 5th Ed.
  • 38. 38 Principles of Web Design 5th Ed.
  • 39. 39 Adding White Space around Images • Add white space around your images to reduce clutter and improve readability • Use the CSS margin property to increase the white space around an image Principles of Web Design 5th Ed.
  • 40. 40 Principles of Web Design 5th Ed.
  • 41. 41 Understanding Computer Color Basics • Monitors display colors by mixing three basic colors of light: red, green, and blue – Intensity ranges from: • 0% (complete absence of color) to 100% (complete presence of color) • Color depth – Amount of data used to create the color • bit (256 colors), 16-bit, and 24-bit (16.7M colors) Principles of Web Design 5th Ed.
  • 42. 42 Color Depth • The amount of data used to create color on a display is called the color depth • If your users have a 24-bit color display, they can appreciate the full-color depth of your images • If your monitor doesn’t support the full color depth of an image, the browser must resort to mixing colors that attempt to match the original colors in the image Principles of Web Design 5th Ed.
  • 43. 43 Principles of Web Design 5th Ed.
  • 44. 44 Specifying CSS Color Values • Color names • RGB color values • Hexadecimal color values Principles of Web Design 5th Ed.
  • 45. 45 Using Color Names • Sets color values using common color names – Blue, gray, red, etc. • Limited to small range of colors • Not a very specific representation of color Principles of Web Design 5th Ed.
  • 46. Principles of Web Design 5th Ed. 46
  • 47. 47 Using RGB Color Values • Numerical values that specify the blending of the red, green, and blue color channels • Range: 0-100% (zero color to max color) – Also: 0-255 (integer) • Can be expressed as percentage or integer: P {color: rgb(0, 100%, 100%);} or P {color: rgb(0, 255, 255);} Principles of Web Design 5th Ed.
  • 48. 48 Using Hexadecimal Color Values • Numerical values that specify the blending of the red, green, and blue color channels – Base 16 number system (0-9, A-F) • Range: 00-FF (zero color to max color) – Example: Red  FF 00 00 – The following rules specify the same color: P {color: #00FFFF;} P {color: rgb(0, 100%, 100%);} P {color: rgb(0, 255, 255);} Principles of Web Design 5th Ed.
  • 49. 49 Understanding Element Layers • Background color layer—the backmost layer, specified by the background-color property • Background image layer—the middle layer, specified by the background-image property • Content layer—the frontmost layer; this is the color of the text content; specified by the color property Principles of Web Design 5th Ed.
  • 50. Principles of Web Design 5th Ed. 50
  • 51. 51 Controlling Color Properties with CSS • Specifying color values • Setting default text color • Changing link colors • Specifying background color • Setting the page background color • Creating a text reverse Principles of Web Design 5th Ed.
  • 52. 52 Specifying Color Values /* color name */ p {color: blue;} /* hexadecimal value */ p {color: #0000ff;} /* RGB numbers */ p {color: rgb(0,0,255);} /* RGB percentages */ p {color: rgb(0%,0%,100%);} The following style rules show the different methods of specifying a color: Principles of Web Design 5th Ed.
  • 53. Principles of Web Design 5th Ed. 53
  • 54. 54 Changing Link Colors • You can change the colors of hypertext links by using the following special CSS classes • link—the unvisited link color • active—the active link color; this is the color displayed when the user points to a link and holds down the mouse button • visited—the visited link color Principles of Web Design 5th Ed.
  • 55. 55 Changing Link Colors • You can use these special classes only with the <a> tag • The syntax uses a colon (:) flag character as shown in the following examples: a:link {color: #000000;} /* new links are black */ a:active {color: #FF0000;} /* active links are red */ a:visited {color: #CCCCCC;} /* visited links are gray */ Principles of Web Design 5th Ed.
  • 56. Principles of Web Design 5th Ed. 56
  • 57. 57 Specifying Background Colors • Background-color – Sets the background color of any element on a Web page (including padding area) – By default, background color of any element is transparent Principles of Web Design 5th Ed.
  • 58. Principles of Web Design 5th Ed. 58
  • 59. Setting Page Background Color • To set the page background color, use body as the selector • The following rule sets a background color for the <body> element body {background-color: #c5f0ff;} Principles of Web Design 5th Ed. 59
  • 60. Principles of Web Design 5th Ed. 60
  • 61. 61 Creating a Text Reverse • The background and foreground colors are reversed • The following rule sets the text color to white and the background color to blue: h1 { color: #fff; padding: .25em; background-color: #f90000; } Principles of Web Design 5th Ed.
  • 62. 62 Principles of Web Design 5th Ed.
  • 64. Specifying a Background Image • The background-image property lets you specify which image to display • Other CSS background properties control how the image is displayed 64
  • 65. Principles of Web Design 5th Ed. 65
  • 66. Principles of Web Design 5th Ed. 66
  • 67. Creating a Page Background • To tile an image across the entire background of the Web page, use body as the selector body {background-image: url(clouds.jpg);} Principles of Web Design 5th Ed. 67
  • 68. 68 Creating an Element Background h1 {background-image: url(bluetex.jpg); padding: .25em;} • Images can be applied to the background of any element • The following rule applies an image to the background of the H1 element: Principles of Web Design 5th Ed.
  • 69. Principles of Web Design 5th Ed. 69
  • 70. 70 Specifying Background Repeat • Controls tiling of background images body { background-image: url(grayivy.jpg); background-repeat: repeat-y; } Principles of Web Design 5th Ed.
  • 71. 71 • Allows creation of a vertically repeating background graphic body { background-image: url(column.jpg); background-repeat: repeat-y; } Creating a Vertical Repeat Principles of Web Design 5th Ed.
  • 72. Principles of Web Design 5th Ed. 72
  • 73. 73 Creating a Horizontal Repeat • Allows creation of a horizontally repeating background graphic body { background-image: url(header.jpg); background-repeat: repeat-x; } Principles of Web Design 5th Ed.
  • 74. Principles of Web Design 5th Ed. 74
  • 75. 75 Creating a Nonrepeating Background Image • Allows creation of a single instance of an image in the background • The following style rule shows the use of the no-repeat value: body { background-image: url(balloon_sm.jpg); background-repeat: no-repeat; } Principles of Web Design 5th Ed.
  • 76. Principles of Web Design, 4th 76 Specifying Background Position • The background-position property lets you use three types of values: percentage, length, or keywords #right { background-image: url(rightgradient.gif); background-repeat: repeat-y; background-position: right; }
  • 77. Principles of Web Design 5th Ed. 77
  • 78. 78 Positioning Vertical and Horizontal Background Images • Positions images that repeat on either the horizontal or vertical axis of the Web page Principles of Web Design 5th Ed.
  • 79. Principles of Web Design 5th Ed. 79
  • 80. Summary • The four popular file formats for the Web are GIF, JPG, PNG, and SVG • Your computer monitor displays color by mixing the three basic colors of light: red, green, and blue (RGB) • Reduce image size to the appropriate dimensions • The color scheme you choose for a Web site should create a distinctive look without detracting from your content’s legibility Principles of Web Design 5th Ed. 80
  • 81. Summary • Use the color property to set foreground colors for elements • Background colors affect any padding areas in the element • Choose background images that do not detract from the legibility of your content • Test your work on different browsers and computing platforms Principles of Web Design 5th Ed. 81