SlideShare une entreprise Scribd logo
1  sur  17
IMAGES
HTML5 & CSS3 Visual Quickstart Guide
Chapter 5
Images for the Web
• Format
  • Graphics used must be in a format that all viewers can see
  • GIF and JPG most widely used
    • PNG is catching up!
    • PNG often better choice than GIF, because it generates smaller file
      sizes and has superior transparency support
  • Current browsers: GIF, JPG, PNG
• Color
  • Almost all Web users have 24-bit or 32-bit monitors
  • All modern monitors display 16m colors
  • In early days, monitors only handled 8-bit colors
    • Restricted us to browser safe colors (16 of them)
  • Inside back cover of book gives fold-out color chart
Size and Resolution
• Digital images measured in pixels
  • A 4MP camera takes pictures 1600 pixels wide by 1200 pixels high
    • Printed at 200 ppi, this is 8 inches by 6 inches
    • On a 72 ppi display, 18 inches by 14 inches

• Average Web pages were constrained to 600 pixels wide,
  because early monitors were 640x480
• Monitors are bigger and bigger (the projector displays
  1280x1024, I think)
  • Users don’t necessarily fill up the monitor with a single web page!
  • Use of smartphones and tablets increasing, so should consider
   screen size and limited download speeds
Size and Resolution (cont’d)
Size and Resolution (cont’d)
• Resolution can mean 2 things:
  • Number of pixels on a monitor or in an image
    • 640 x 480
    • 1024 x 768
  • Number of pixels in an inch of that monitor or image
    • 72 ppi
    • 86 ppi

• The higher the resolution, the more pixels
• On paper, more pixels can add size or detail
  • On screen, more pixels always means bigger size
Speed
• Large image files take time to download
• Larger an image’s file size, longer it takes to download
• Speed up by compressing the image
  • LZW (for GIF)
  • JPEG
  • PNG
• LZW effective for logos, rendered text, other images with
 large areas of a single color
  • If you can reduce the number of colors in an image, LZW can often
   (but not always) compress image even more
• JPEG best for photographs and other images with many
 colors
Speed (cont’d)
• GIF images limited to 256 colors
• JPEG has 2 main disadvantages
   • Compression information takes up a lot of space (not worth it for
     small images)
   • Compression is lossy (permanently eliminates details to save
     space)
• PNG compresses better than LZW, without losing
 information.
  • Does not allow animation, as GIF does
  • Limited support in IE 6
Transparency & Animation
• GIF and PNG allow transparency
  • JPEG does not
• Which format is better at transparency?
  • In a GIF, a pixel is either transparent or not transparent; no in
    between
  • PNG supports alpha transparency
     • Partial and full transparency
     • Allows for 50% opaqueness, for example

• Animated images can be saved in GIF format, but not
 JPEG or PNG
  • Can also create animation with Flash, CSS, and JavaScript
Getting Images
• Use Google
  • But be careful of copyright infringement!
  • Creative Commons License
• Stock photography and image CDs
• Stock photography Web sites
• Digital cameras, film development to CD
• If you create your own, save as GIF, JPEG, or PNG
   • Not BMP—only IE users will be able to see them!
Choosing an Image Editor
• Photoshop (expensive)
• Photoshop Elements (quite a bit cheaper, but still
    expensive)
•   Fireworks
•   Paint Shop Pro
•   GIMP
•   For simple editing (size), MS Office’s picture manager (on
    Windows) or Preview (on Mac)
Properly Optimizing Images for the Web
• Main objective: smallest file size possible with acceptable
  image quality
• Images should be in RGB mode, not CMYK (which is for
  print)
• PNG can be used for computer-generated and ―natural‖
  color images
  • Often better than GIF, but not quite as good as JPEG
  • Photoshop’s PNG compression algorithms are lackluster
  • Fireworks’ are better
• Adobe’s Save for Web command creates a new image
 file, leaving original intact. Nice if you’re working with
 uncompressed original image, and want to re-edit without
 losing data
Inserting Images on a Page
• <img src=―image.url‖ />
   • ―image.url‖ indicates location of image file on the server
• Add a p or br tag before an image to start on a new line
• Images must be uploaded to server before visitors will be
  able to see them
• Test your image, and think about people with slower
  Internet connections!
Offering Alternate Text
• Slow connection, handhelds, screen readers – these folks
  often don’t download images at all!
• Offer alternate text for when images don’t appear
  • <img src=―image.url‖ alt=―Image‖ />
• The alt attribute is required in HTML5
• Screen readers such as JAWS and VoiceOver can read
  alternate text out loud so blind/visually impaired visitors
  can get an idea of what the image is about
• If image is just for formatting, like a horizontal line or a
  bullet image, W3C suggests you use alt=“”
Specifying Size for Speedier Viewing
• If you provide image dimensions, browser can fill in
  around the image so visitors have something to read
  while image downloads
• Find the size in your browser:
  • Right-click (in Windows) or Control-click (in Mac) the image
  • Choose Properties or Get Image Info
• Find the size with Photoshop or Photoshop Elements
  • Open image
  • Make document window wide enough so document info (―Doc‖) bar
    visible in lower-left border
  • Hold Option key (or Alt on Windows) and click in document info bar
Specifying Size for Speedier Viewing
(cont’d)
• Note: don’t do this to change the image size!!!
• Figure out the size of your image
• Specify width and height as attributes in img tag
  • <img src=―image.url‖ alt=―Image‖ width=―200‖ height=―200‖ />
Adding an Icon for Your Web Site
• Most browsers now support associating small image with
 Web site
  • Displayed in Address bar, Favorites menu, or elsewhere
  • Images called favicons, which is short for Favorites Icon.
  • Apple asks for larger icons for home screens in iOS; recommend
   114 pixels by 114 pixels
    • iOS will add rounded corners, drop shadow, reflective shine

• To add an icon for your Web site:
   • Create a 16x16 pixel image
   • Create a 114x114 pixel image, in PNG format
   • In the head section, type:
    • <link rel=―icon‖ href=―favicon.ico‖ type=―image/x-icon‖ />
    • <link rel=―apple-touch-icon‖ href=―/apple-touch-icon.png‖ />
Adding an Icon for Your Web Site (cont’d)
• Favicons should be saved in .ico format
  • Telegraphics makes a plugin for creating .ico files in Photoshop
    • http://www.telegraphics.com.au/sw/
  • Some browsers (not Internet Explorer) support favicons in GIF
    (including animated GIFs) and PNG format. Just be sure to use the
    proper MIME type in the link element
  • IE originally required favicon.ico file to be placed in root directory of
    web site.
    • This is no longer the case
    • Browsers may still look there if link element not present or not
      understood (by older browsers)

Contenu connexe

Tendances

File types alis rose
File types alis rose File types alis rose
File types alis rose alisrose1
 
Digital graphics pro forma1
Digital graphics pro forma1Digital graphics pro forma1
Digital graphics pro forma1Harrison Cox
 
File types pro forma
File types pro formaFile types pro forma
File types pro formaCheekiBreeki
 
Digital graphics pro forma
Digital graphics pro formaDigital graphics pro forma
Digital graphics pro formaJosh Highton
 
File types pro forma(1)
File types pro forma(1)File types pro forma(1)
File types pro forma(1)Benedict Terry
 
Digital graphics pro forma copy
Digital graphics pro forma copyDigital graphics pro forma copy
Digital graphics pro forma copyRichard Acaster
 
Digital graphics pro forma
Digital graphics pro formaDigital graphics pro forma
Digital graphics pro formajordan armytage
 
Graphics case study.pptx (1)
Graphics case study.pptx (1)Graphics case study.pptx (1)
Graphics case study.pptx (1)Sam Hughes
 
File Types Pro Forma
File Types Pro FormaFile Types Pro Forma
File Types Pro Formajessstanton17
 
File types pro forma
File types pro formaFile types pro forma
File types pro formaJessStanton_
 
File types pro forma
File types pro formaFile types pro forma
File types pro formaOli Walwyn
 
Web site questions before starting own site (1)
Web site questions before starting own site (1)Web site questions before starting own site (1)
Web site questions before starting own site (1)Eujin Hong
 
File Types Pro Forma
File Types Pro FormaFile Types Pro Forma
File Types Pro FormaNatalie-Lynch
 
File types pro forma
File types pro formaFile types pro forma
File types pro formaalisrose1
 
Digital graphics file formats
Digital graphics file formatsDigital graphics file formats
Digital graphics file formatsthomas-armstrong
 
File types pro forma
File types pro formaFile types pro forma
File types pro formaSophieBaker98
 
Lecture 3 photo_v_ideo_graph
Lecture 3 photo_v_ideo_graphLecture 3 photo_v_ideo_graph
Lecture 3 photo_v_ideo_graphZoran Richliev
 
Helpsheet 2
Helpsheet 2Helpsheet 2
Helpsheet 2hiletman
 

Tendances (20)

File types alis rose
File types alis rose File types alis rose
File types alis rose
 
File types.
File types.File types.
File types.
 
Digital graphics pro forma1
Digital graphics pro forma1Digital graphics pro forma1
Digital graphics pro forma1
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
 
Digital graphics pro forma
Digital graphics pro formaDigital graphics pro forma
Digital graphics pro forma
 
File types pro forma(1)
File types pro forma(1)File types pro forma(1)
File types pro forma(1)
 
Digital graphics pro forma copy
Digital graphics pro forma copyDigital graphics pro forma copy
Digital graphics pro forma copy
 
Digital graphics pro forma
Digital graphics pro formaDigital graphics pro forma
Digital graphics pro forma
 
Graphics case study.pptx (1)
Graphics case study.pptx (1)Graphics case study.pptx (1)
Graphics case study.pptx (1)
 
File Types Pro Forma
File Types Pro FormaFile Types Pro Forma
File Types Pro Forma
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
 
Digital Photograpy
Digital PhotograpyDigital Photograpy
Digital Photograpy
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
 
Web site questions before starting own site (1)
Web site questions before starting own site (1)Web site questions before starting own site (1)
Web site questions before starting own site (1)
 
File Types Pro Forma
File Types Pro FormaFile Types Pro Forma
File Types Pro Forma
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
 
Digital graphics file formats
Digital graphics file formatsDigital graphics file formats
Digital graphics file formats
 
File types pro forma
File types pro formaFile types pro forma
File types pro forma
 
Lecture 3 photo_v_ideo_graph
Lecture 3 photo_v_ideo_graphLecture 3 photo_v_ideo_graph
Lecture 3 photo_v_ideo_graph
 
Helpsheet 2
Helpsheet 2Helpsheet 2
Helpsheet 2
 

En vedette

Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7Jeff Byrnes
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3Jeff Byrnes
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1Jeff Byrnes
 
Castro Chapter 6
Castro Chapter 6Castro Chapter 6
Castro Chapter 6Jeff Byrnes
 
Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis ppJoeVelarde
 
Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15Jeff Byrnes
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2Jeff Byrnes
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4Jeff Byrnes
 

En vedette (8)

Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1
 
Castro Chapter 6
Castro Chapter 6Castro Chapter 6
Castro Chapter 6
 
Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis pp
 
Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4
 

Similaire à Castro Chapter 5

Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web ImagesSteve Guinan
 
Types of Images & File Types
Types of Images & File TypesTypes of Images & File Types
Types of Images & File TypesChris Chapman
 
File format help sheet version 2
File format help sheet version 2File format help sheet version 2
File format help sheet version 2bennyboyhunt
 
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 TallentBookNet Canada
 
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 sSEOSteve Mortiboy
 
File format help sheet completed
File format help sheet completedFile format help sheet completed
File format help sheet completedKColliver
 
The high resolution web
The high resolution webThe high resolution web
The high resolution webPatric Lanhed
 
File types pro forma power point
File types pro forma power pointFile types pro forma power point
File types pro forma power pointbobtrelfa
 
Digital Image Basics
Digital Image BasicsDigital Image Basics
Digital Image Basicsmturre
 
Portfolio Presentation Final
Portfolio Presentation FinalPortfolio Presentation Final
Portfolio Presentation FinalShea Hinds
 

Similaire à Castro Chapter 5 (20)

Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
 
P1.1
P1.1P1.1
P1.1
 
Unit 78 technical file
Unit 78 technical fileUnit 78 technical file
Unit 78 technical file
 
Types of Images & File Types
Types of Images & File TypesTypes of Images & File Types
Types of Images & File Types
 
Artdm171 Week6 Images
Artdm171 Week6 ImagesArtdm171 Week6 Images
Artdm171 Week6 Images
 
Chapter13
Chapter13Chapter13
Chapter13
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Lab#2 illustrator
Lab#2 illustratorLab#2 illustrator
Lab#2 illustrator
 
File format help sheet version 2
File format help sheet version 2File format help sheet version 2
File format help sheet version 2
 
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
 
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
 
File format help sheet completed
File format help sheet completedFile format help sheet completed
File format help sheet completed
 
The high resolution web
The high resolution webThe high resolution web
The high resolution web
 
Graphics and imagea
Graphics and imageaGraphics and imagea
Graphics and imagea
 
Image Optimization
Image OptimizationImage Optimization
Image Optimization
 
File types pro forma power point
File types pro forma power pointFile types pro forma power point
File types pro forma power point
 
Digital Image Basics
Digital Image BasicsDigital Image Basics
Digital Image Basics
 
Portfolio Presentation Final
Portfolio Presentation FinalPortfolio Presentation Final
Portfolio Presentation Final
 
Ppt ch08
Ppt ch08Ppt ch08
Ppt ch08
 
Ppt ch08
Ppt ch08Ppt ch08
Ppt ch08
 

Plus de Jeff Byrnes

Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11Jeff Byrnes
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10Jeff Byrnes
 
Castro Chapter 9
Castro Chapter 9Castro Chapter 9
Castro Chapter 9Jeff Byrnes
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8Jeff Byrnes
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2Jeff Byrnes
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2Jeff Byrnes
 

Plus de Jeff Byrnes (6)

Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10
 
Castro Chapter 9
Castro Chapter 9Castro Chapter 9
Castro Chapter 9
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 

Dernier (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

Castro Chapter 5

  • 1. IMAGES HTML5 & CSS3 Visual Quickstart Guide Chapter 5
  • 2. Images for the Web • Format • Graphics used must be in a format that all viewers can see • GIF and JPG most widely used • PNG is catching up! • PNG often better choice than GIF, because it generates smaller file sizes and has superior transparency support • Current browsers: GIF, JPG, PNG • Color • Almost all Web users have 24-bit or 32-bit monitors • All modern monitors display 16m colors • In early days, monitors only handled 8-bit colors • Restricted us to browser safe colors (16 of them) • Inside back cover of book gives fold-out color chart
  • 3. Size and Resolution • Digital images measured in pixels • A 4MP camera takes pictures 1600 pixels wide by 1200 pixels high • Printed at 200 ppi, this is 8 inches by 6 inches • On a 72 ppi display, 18 inches by 14 inches • Average Web pages were constrained to 600 pixels wide, because early monitors were 640x480 • Monitors are bigger and bigger (the projector displays 1280x1024, I think) • Users don’t necessarily fill up the monitor with a single web page! • Use of smartphones and tablets increasing, so should consider screen size and limited download speeds
  • 4. Size and Resolution (cont’d)
  • 5. Size and Resolution (cont’d) • Resolution can mean 2 things: • Number of pixels on a monitor or in an image • 640 x 480 • 1024 x 768 • Number of pixels in an inch of that monitor or image • 72 ppi • 86 ppi • The higher the resolution, the more pixels • On paper, more pixels can add size or detail • On screen, more pixels always means bigger size
  • 6. Speed • Large image files take time to download • Larger an image’s file size, longer it takes to download • Speed up by compressing the image • LZW (for GIF) • JPEG • PNG • LZW effective for logos, rendered text, other images with large areas of a single color • If you can reduce the number of colors in an image, LZW can often (but not always) compress image even more • JPEG best for photographs and other images with many colors
  • 7. Speed (cont’d) • GIF images limited to 256 colors • JPEG has 2 main disadvantages • Compression information takes up a lot of space (not worth it for small images) • Compression is lossy (permanently eliminates details to save space) • PNG compresses better than LZW, without losing information. • Does not allow animation, as GIF does • Limited support in IE 6
  • 8. Transparency & Animation • GIF and PNG allow transparency • JPEG does not • Which format is better at transparency? • In a GIF, a pixel is either transparent or not transparent; no in between • PNG supports alpha transparency • Partial and full transparency • Allows for 50% opaqueness, for example • Animated images can be saved in GIF format, but not JPEG or PNG • Can also create animation with Flash, CSS, and JavaScript
  • 9. Getting Images • Use Google • But be careful of copyright infringement! • Creative Commons License • Stock photography and image CDs • Stock photography Web sites • Digital cameras, film development to CD • If you create your own, save as GIF, JPEG, or PNG • Not BMP—only IE users will be able to see them!
  • 10. Choosing an Image Editor • Photoshop (expensive) • Photoshop Elements (quite a bit cheaper, but still expensive) • Fireworks • Paint Shop Pro • GIMP • For simple editing (size), MS Office’s picture manager (on Windows) or Preview (on Mac)
  • 11. Properly Optimizing Images for the Web • Main objective: smallest file size possible with acceptable image quality • Images should be in RGB mode, not CMYK (which is for print) • PNG can be used for computer-generated and ―natural‖ color images • Often better than GIF, but not quite as good as JPEG • Photoshop’s PNG compression algorithms are lackluster • Fireworks’ are better • Adobe’s Save for Web command creates a new image file, leaving original intact. Nice if you’re working with uncompressed original image, and want to re-edit without losing data
  • 12. Inserting Images on a Page • <img src=―image.url‖ /> • ―image.url‖ indicates location of image file on the server • Add a p or br tag before an image to start on a new line • Images must be uploaded to server before visitors will be able to see them • Test your image, and think about people with slower Internet connections!
  • 13. Offering Alternate Text • Slow connection, handhelds, screen readers – these folks often don’t download images at all! • Offer alternate text for when images don’t appear • <img src=―image.url‖ alt=―Image‖ /> • The alt attribute is required in HTML5 • Screen readers such as JAWS and VoiceOver can read alternate text out loud so blind/visually impaired visitors can get an idea of what the image is about • If image is just for formatting, like a horizontal line or a bullet image, W3C suggests you use alt=“”
  • 14. Specifying Size for Speedier Viewing • If you provide image dimensions, browser can fill in around the image so visitors have something to read while image downloads • Find the size in your browser: • Right-click (in Windows) or Control-click (in Mac) the image • Choose Properties or Get Image Info • Find the size with Photoshop or Photoshop Elements • Open image • Make document window wide enough so document info (―Doc‖) bar visible in lower-left border • Hold Option key (or Alt on Windows) and click in document info bar
  • 15. Specifying Size for Speedier Viewing (cont’d) • Note: don’t do this to change the image size!!! • Figure out the size of your image • Specify width and height as attributes in img tag • <img src=―image.url‖ alt=―Image‖ width=―200‖ height=―200‖ />
  • 16. Adding an Icon for Your Web Site • Most browsers now support associating small image with Web site • Displayed in Address bar, Favorites menu, or elsewhere • Images called favicons, which is short for Favorites Icon. • Apple asks for larger icons for home screens in iOS; recommend 114 pixels by 114 pixels • iOS will add rounded corners, drop shadow, reflective shine • To add an icon for your Web site: • Create a 16x16 pixel image • Create a 114x114 pixel image, in PNG format • In the head section, type: • <link rel=―icon‖ href=―favicon.ico‖ type=―image/x-icon‖ /> • <link rel=―apple-touch-icon‖ href=―/apple-touch-icon.png‖ />
  • 17. Adding an Icon for Your Web Site (cont’d) • Favicons should be saved in .ico format • Telegraphics makes a plugin for creating .ico files in Photoshop • http://www.telegraphics.com.au/sw/ • Some browsers (not Internet Explorer) support favicons in GIF (including animated GIFs) and PNG format. Just be sure to use the proper MIME type in the link element • IE originally required favicon.ico file to be placed in root directory of web site. • This is no longer the case • Browsers may still look there if link element not present or not understood (by older browsers)