SlideShare a Scribd company logo
Delivering Beautiful and Fast
Images and Video
Doug Sillars
@DougSillars
NottsJS
October 9, 2018
Contact Me:
@DougSillars
Doug.Sillars@gmail.com
www.dougsillars.com
Doug Sillars
Freelance Developer Relations
Performance Audits: Web/Native
Workshops:
Performance/Images/Video
http://bit.ly/HighPerformanceAndroidApps
Notts js fastandbeautiful
0.5
0.6
0.7
0.8
0.9
Standing in Line Standing on the
edge of a virtual
cliff
Experiencing
Mobile Delays
Solving a Math
Problem
https://www.ericsson.com/res/docs/2016/mobility-report/emr-feb-2016-the-stress-of-steaming-delays.pdf
Stress
Large Downloads Induce Delays in Rendering
3s: 53% of Users Abandon Mobile Sites
500ms: 26% Frustration
8% Engagement
100ms: 1% Revenue Walmart & Amazon (Desktop 2001)
4% Mobile Users Throw Their Phones
https://www.doubleclickbygoogle.com/articles/mobile-speed-matters
http://bit.ly/mobileWebStress
http://www.globaldots.com/how-website-speed-affects-conversion-rates/
https://www.mobilejoomla.com/blog/172-responsive-design-vs-server-side-solutions-infographic.html
Images & Video make up 75% of Web Content
HTTPArchive mobile websites 15/02/18
4 Simple Image Optimizations
4 Simple Image Optimizations
1. Quality
2. Format
3. Sizing
4. Lazy Loading
4 Simple Image Optimizations
1. Quality
2. Format
3. Sizing
4. Lazy Loading
4 Simple Image Optimizations
Httparchive.org Webpagetest.org
4 Simple Image Optimizations
1. Quality
2. Format
3. Sizing
4. Lazy Loading
Image Quality
magick -quality 85 riga.jpg riga85.jpg
http://res.cloudinary.com/dougsillars/image/upload/q_85/v1520504964/IMG_20180301_114117_tzasan.jpg
Lighthouse:
Recommends 85% quality on all images
https://developers.google.com/speed/docs/insights/OptimizeImages
100%
3.6 MB
http://res.cloudinary.com/dougsillars/image/upload/v1529005982/IMG_20180614_184507_ssuk1i.jpg
85%
1.87 MB
q_85
http://res.cloudinary.com/dougsillars/image/upload/q_85/v1529005982/IMG_20180614_184507_ssuk1i.jpg
Image Quality Use “In The Wild”
500,000 mobile sites
Analyzed 3/15/18
Image Quality Use “In The Wild”
Median Savings (50th percentile):
• 2.83 seconds faster page load
• 419KB less data
50%
914 KB
q_50
http://res.cloudinary.com/dougsillars/image/upload/q_50/v1529005982/IMG_20180614_184507_ssuk1i.jpg
20%
513 KB
q_20
http://res.cloudinary.com/dougsillars/image/upload/q_20/v1529005982/IMG_20180614_184507_ssuk1i.jpg
Graphing the Results
https://developers.google.com/speed/docs/insights/OptimizeImages
Graphing the Results
https://developers.google.com/speed/docs/insights/OptimizeImages
Automate Quality vs. File Size
• Butteraugli
• SSIM: Structural SIMilarity
https://github.com/technopagan/cjpeg-dssim
cjpeg-dssim jpegoptim riga.jpg
http://res.cloudinary.com/dougsillars/image/upload/q_auto/v1529005982/IMG_20180614_184507_ssuk1i.jpg
SSIM
1.46 MB
http://res.cloudinary.com/dougsillars/image/upload/q_auto/v1529005982/IMG_20180614_184507_ssuk1i.jpg
Graphing the Results
https://developers.google.com/speed/docs/insights/OptimizeImages
Results:
• Test Load on Motorola G4:
4 Simple Image Optimizations
1. Quality
2. Format
3. Sizing
4. Lazy Loading
Image Formats – Average Size
HTTPArchive mobile websites 15/02/18
Image Formats – Average Size
HTTPArchive mobile websites 15/02/18
Scalable Vector Graphics (SVG)
Images drawn as shapes
infinitely scalable
XML - Can be added inline to HTML document
https://gist.github.com/hail2u/2884613?short_path=66a60ff
Scalable Vector Graphics (SVG)
Images drawn as shapes
infinitely scalable
XML - Can be added inline to HTML document
https://gist.github.com/hail2u/2884613?short_path=66a60ff
Scalable Vector Graphics (SVG)
Scalable Vector Graphics (SVG)
Scalable Vector Graphics (SVG)
https://github.com/google/brotli
Image Formats – Average Size
HTTPArchive mobile websites 15/02/18
File Format: WebP
https://caniuse.com/#feat=webp
Notts js fastandbeautiful
Notts js fastandbeautiful
SSIM + WebP
986 KB
http://res.cloudinary.com/dougsillars/image/upload/q_auto,f_auto/v1529005982/IMG_20180614_184507_
File Format: Web
<picture>
<source width = "100%" type="image/webp" srcset=”riga.webp">
<img width = "100%" src=”riga_cjpeg_dssim.jpg"
alt=”Riga, Latvia">
</picture>
Image Format Use “In The Wild”
500,000 mobile sites
Analyzed 3/15/18
Image Format Use “In The Wild”
500,000 mobile sites
Analyzed 3/15/18
4 Simple Image Optimizations
1. Quality
2. Format
3. Sizing
4. Lazy Loading
Image Sizing
-
Image Sizing
Image Sizing
-
Image Sizing
624
832
-
Image Sizing
624
832
12,979,000 pixels
519,000 pixels
_________________
-
12,460,000 pixels
Image Sizing
624
832
12,979,000 pixels
519,000 pixels
_________________
-
12,460,000 pixels
Image Sizing
https://twitter.com/paulcalvano/status/928751141843808256
Image Sizing
-
Responsive Images:
Generate a set of images
25 KB difference in size
Responsive Images
624
832
625,000 pixels
-
106,000 pixels
519,000 pixels
_________________
Responsive Breakpoint Generation
https://github.com/cloudinary/responsive_breakpoints_generator
http://www.responsivebreakpoints.com/
Responsive Images
Responsive Images
Responsive Images
Responsive Images Use “In The Wild”
500,000 mobile sites
Analyzed 3/15/18
Responsive Images Use “In The Wild”
442,000 mobile sites
Analyzed 3/15/18
4 Simple Image Optimizations
1. Quality
2. Format
3. Sizing
4. Lazy Loading
Lazy Load
https://calendar.perfplanet.com/2017/progressive-image-loading-using-intersection-observer-and-sqip/
Lazy Load
https://calendar.perfplanet.com/2017/progressive-image-loading-using-intersection-observer-and-sqip/
Lazy Loading Use “In The Wild”
442,000 mobile sites
Analyzed 3/15/18
Lazy Loading Use “In The Wild”
442,000 mobile sites
Analyzed 3/15/18
Preview Images
Optimizing Content Delivery
Preview Images
https://github.com/technopagan/sqip
Lazy Loading: Experiments
Lazy Loading: Experiments
Lazy Loading: Experiments
Animated GIFs
Original MP4
1.4 MB
Animated GIFs
Animated GIFs
Animated GIF
3.8 MB
270% larger
Animated GIFs
Animated GIFs
MP4: 256 colors
247KB
93% smaller
Animated GIFs
Video Tags:
<video loop autoplay muted playsinline controls = "false” src="goats.mp4”/>
Video is not pre-loaded, will be last to download
Img tags are fast!
<picture>
<source type="video/mp4" srcset=”goats.mp4">
<source type="image/webp" srcset=”goats.webp">
<img src=”goats.gif">
</picture>
https://calendar.perfplanet.com/2017/animated-gif-without-the-gif/
Animated GIFs
Video
75
Video
Buffer Rage: a state of uncontrollable
fury or violent anger induced by delayed
or interrupted streaming video content
http://www.ineoquest.com/press-releases/new-research-reveals-buffer-rage-as-techs-newest-epidemic
Video Quality Metrics
1.Does the Video Start?
2.Does the Video Stall?
3.Does it Look Good?
Video Startup
Conviva creen_Streaming_TV_Census_Report_FINAL.pdf
Q1 2018:
Video Startup
Conviva creen_Streaming_TV_Census_Report_FINAL.pdf
Q1 2018: Video Startup
16.9B total Video plays
400M Fail to Start
2B Abandoned before Start
~800M hours of video
playback lost
Video Startup
Conviva creen_Streaming_TV_Census_Report_FINAL.pdf
Q1 2018: Video Startup
16.9B total Video plays
400M Fail to Start
2B Abandoned before Start
~800M hours of video
playback lost
Video Fails To Start
Video Startup Failure
Video Startup
Conviva creen_Streaming_TV_Census_Report_FINAL.pdf
Q1 2018: Video Startup
16.9B total Video plays
400M Fail to Start
2B Abandoned before Start
Video Startup Delay
After 2 seconds,
every additional
second corresponds
to 5.8% increase in
abandonment
https://www.akamai.com/kr/ko/multimedia/documents/technical-publication/video-stream-quality-impacts-viewer-behavior-inferring-causality-using-quasi-experimental-designs-technical-publication.pdf
Video Startup Delay
https://www.akamai.com/kr/ko/multimedia/documents/technical-publication/video-stream-quality-impacts-viewer-behavior-inferring-causality-using-quasi-experimental-designs-technical-publication.pdf
Preload When It Makes Sense
Ad Playback Video
Download
Preload When It Makes Sense
Ad Playback Video
Download
Preload When It Makes Sense
Ad Playback
Video
Download
..be Careful with Video Preload
Preload = “auto”
…be Careful with Preload
Background Video
Video Background
Video (as Downloaded): 5.3 MB
Video 5 MB
Audio 250 KB 5% of file
Best Practice:
To save bandwidth, remove the audio stream from videos that
are played silently.
Video Background: Mobile
Best Practice:
If Viewport will not support Video…
Don’t Download it
Video Background
Video Background
33.6 MB
27s
2560 x 1226
10 MBPS
Video Background
Best Practice:
Resize Video to reasonable size.
33.6 MB
27s
2560 x 1226
10 MBPS
Video Background
Best Practice:
Resize Video to reasonable size.
PROTIP: Renaming the file is not enough…
Video Resizing
• 1920x1080: 8.1 MB
• 1280x720: 4.3 MB
• 1080x608: 3.3 MB
• 720x405: 1.76 MB
http://res.cloudinary.com/dougsillars/video/upload/vc_auto,w_720/v1533591785/depend_p2ryou.mp4
Video Third Parties
Video Third Parties
Video Third Parties
Video Third Parties
Video Streaming
Manifest File:
List of Available
Streams
Player Chooses a Stream Stream Manifest:
List of Video Segments
Player Downloads
Segments into buffer
Video Plays
Video Plays
Optimizing Video Delivery
Video Streaming
Player can estimate
network throughput
Optimal video Bitrate
HTTPArchive
Mobile: 1.6 MBPS
Desktop 5 MBPS
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Video Tracks
Video Tracks (iFrames)
Audio Tracks &
Subtitles
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Video Tracks
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Optimizing Video Delivery
Video Streaming
Manifest File:
List of Available
Streams
Player selects high
bitrate stream Stream Manifest:
List of Video Segments
Buffer takes a long
time to fill
Video Does Not Play
Player chooses low
bitrate
Buffer Fills Quickly
Video Plays
Video Startup
Conviva creen_Streaming_TV_Census_Report_FINAL.pdf
Q1 2018: Video Startup
Average Video Start Time:
N. America: 4.91s
Asia: 3.00s
Europe: 4.30s
Video Streaming: Startup Time
Low -> High
High => Low
Middle (Goldilocks)
Video Startup
10s 11s 12s 13s 14s 15s 16s 17s
4k Low->High:
4K Middle
(Goldilocks):
4k:High->Low:
Video Startup
4k Low->High:
4K Middle
(Goldilocks):
4k:High->Low:
PROs: CONS:
Fast Startup Initial Quality: Low
Other Connections:
Initial Quality: Low
Very slow startup
Fast Connections:
Initial Quality: High
Initial Quality: Good
Initial Startup: Not
fast, but not slow
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8 Testing with WebPageTest 3G
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Testing with WebPageTest 3G
Video Streaming: Manifest File
600k.m3u8
Video Streaming: Manifest File
600k.m3u8
Video Streaming: Manifest File
https://hls.ted.com/talks/2208.m3u8
Conclusion
Optimize Image:
Quality
Format
Sizing
Lazy Load if Possible
Only download Video when displayed
Strip audio if silent
Resize Videos for Mobile
Audit 3rd Party Videos
Streaming: Start with lower bitrates to speed video playback
Streaming: Conservative bitrates *may* reduce stalls, but will lower quality
Images
Video
Summary
Testing:
WebPageTest https://www.webpagetest.org
HttpArchive https://httparchive.org
Images:
ImageMagick https://www.imagemagick.org
SSIM https://github.com/technopagan/cjpeg-dssim
LazySizes https://github.com/aFarkas/lazysizes
Responsive Breakpoints http://www.responsivebreakpoints.com/
Cloudinary https://www.cloudinary.com
Tooling
Conclusion
Images and Video
Can Be Beautiful AND Fast

More Related Content

PPTX
Bordeaux js fastandbeautiful
PPTX
Mobile era fastandbeautiful
PPTX
Devoxx be fast and beautiful images
PPTX
Devfest Siberia Fast and Beautiful Images and Video
PPTX
Parisjs fastvideoandimages
PPTX
Beautiful and Fast Images
PPTX
Waterford fast images
PPTX
Perf ug fastandbeautiful
Bordeaux js fastandbeautiful
Mobile era fastandbeautiful
Devoxx be fast and beautiful images
Devfest Siberia Fast and Beautiful Images and Video
Parisjs fastvideoandimages
Beautiful and Fast Images
Waterford fast images
Perf ug fastandbeautiful

What's hot (20)

PPTX
Ux connect london_fastandbeautiful
PPTX
Fast and Beautiful Images and Video
PPTX
Fast and Beautiful Images: DublinJS
PPTX
Cork ux Meetup
PPTX
Imagesandvideo stockholm fastandbeautiful
PPTX
PyconUK: Fast and Beautiful Images
POTX
Its timetostopstalling cambridgemot
PPTX
Fastandbeautiful belfast
PPTX
Hamburg web perf meetup
PPTX
Imagesandvideo tallinn
POTX
Its timetostopstalling londroid
PPTX
OSCAL: Free and Open Source Tools for Image and Video Performance
PPTX
Webcamp fastandbeautiful
PPTX
Cologne webperf
PDF
Responsive Images and Video
POTX
Its timetostopstalling sw_mobile_bristol
POTX
Mobile web perf Amsterdam Tech Tips
PDF
Building an Appier Web - May 2016
POTX
Dublin Tech Talks
POTX
Its timetostopstalling barcelonajs
Ux connect london_fastandbeautiful
Fast and Beautiful Images and Video
Fast and Beautiful Images: DublinJS
Cork ux Meetup
Imagesandvideo stockholm fastandbeautiful
PyconUK: Fast and Beautiful Images
Its timetostopstalling cambridgemot
Fastandbeautiful belfast
Hamburg web perf meetup
Imagesandvideo tallinn
Its timetostopstalling londroid
OSCAL: Free and Open Source Tools for Image and Video Performance
Webcamp fastandbeautiful
Cologne webperf
Responsive Images and Video
Its timetostopstalling sw_mobile_bristol
Mobile web perf Amsterdam Tech Tips
Building an Appier Web - May 2016
Dublin Tech Talks
Its timetostopstalling barcelonajs
Ad

Similar to Notts js fastandbeautiful (14)

PPTX
Fast and Beautiful Images: PyConWeb
PPTX
Imagesandvideo voxxeddays
PPTX
Imagesandvideo stockholm webmeetup
PPTX
Its Time To Stop Stalling: Mobile App and Video Performance
POTX
Its timetostopstalling limerick
POTX
Mobile App Performance, Dublin MOT
PPTX
Its timetostopstalling pentabar
POTX
Mobile App Performance, Firenze
POTX
Its timetostopstalling gdg_dublin
PPTX
Edi react fastandbeautiful
PPTX
Hackference
PPTX
Mcr fredfastvideoandimages
POTX
Its Time To Stop Stalling Bucharest
PPTX
Fastandbeautiful zagrebtechsauna
Fast and Beautiful Images: PyConWeb
Imagesandvideo voxxeddays
Imagesandvideo stockholm webmeetup
Its Time To Stop Stalling: Mobile App and Video Performance
Its timetostopstalling limerick
Mobile App Performance, Dublin MOT
Its timetostopstalling pentabar
Mobile App Performance, Firenze
Its timetostopstalling gdg_dublin
Edi react fastandbeautiful
Hackference
Mcr fredfastvideoandimages
Its Time To Stop Stalling Bucharest
Fastandbeautiful zagrebtechsauna
Ad

More from Doug Sillars (20)

PPTX
Fastandbeautiful gdg sacremento
PPTX
Fastandbeautiful gd glittlerock
PPTX
Fastandbeautiful webinale
PPTX
Ai powered images-pythonljubjana
PPTX
Video js zagreb
PDF
Vkmdp cologne
PPTX
Ai powered images-gdgtirana
PPTX
A rt gallery pantalks
PPTX
Ai powered images-sarajevo
PPTX
A rt gallery hub387
PPTX
Ai powered images-zurichpydata
PPTX
Fastandbeautiful vienna
PPTX
Ai powered images-opieaivienna
PPTX
A rt gallery devfestlondon
PPTX
Fastandbeautiful devfest london
PPTX
A rt gallery cardiff
PPTX
Ai powered images-mobileera
PPTX
Fastandbeautiful oredev
PPTX
A rt gallery oredev
PPTX
A rt gallery webcamp-zg
Fastandbeautiful gdg sacremento
Fastandbeautiful gd glittlerock
Fastandbeautiful webinale
Ai powered images-pythonljubjana
Video js zagreb
Vkmdp cologne
Ai powered images-gdgtirana
A rt gallery pantalks
Ai powered images-sarajevo
A rt gallery hub387
Ai powered images-zurichpydata
Fastandbeautiful vienna
Ai powered images-opieaivienna
A rt gallery devfestlondon
Fastandbeautiful devfest london
A rt gallery cardiff
Ai powered images-mobileera
Fastandbeautiful oredev
A rt gallery oredev
A rt gallery webcamp-zg

Recently uploaded (20)

PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
A Presentation on Artificial Intelligence
PDF
Hybrid model detection and classification of lung cancer
PDF
Encapsulation theory and applications.pdf
PDF
Mushroom cultivation and it's methods.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Heart disease approach using modified random forest and particle swarm optimi...
WOOl fibre morphology and structure.pdf for textiles
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Programs and apps: productivity, graphics, security and other tools
A Presentation on Artificial Intelligence
Hybrid model detection and classification of lung cancer
Encapsulation theory and applications.pdf
Mushroom cultivation and it's methods.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Tartificialntelligence_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Hindi spoken digit analysis for native and non-native speakers
SOPHOS-XG Firewall Administrator PPT.pptx
Enhancing emotion recognition model for a student engagement use case through...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Web App vs Mobile App What Should You Build First.pdf
MIND Revenue Release Quarter 2 2025 Press Release
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Notts js fastandbeautiful

Editor's Notes

  • #23: 47% smaller!
  • #29: 1149 bytes, 700 Zipped
  • #30: 1149 bytes, 700 Zipped
  • #31: 1149 bytes, 700 Zipped
  • #32: 1149 bytes, 700 Zipped
  • #33: 1149 bytes, 700 Zipped
  • #38: 47% smaller! Or 65% smaller from original!
  • #64: file:///Users/demo/Documents/reponsiveimages.html
  • #91: www.kidzania.com
  • #92: www.kidzania.com
  • #93: www.kidzania.com
  • #94: www.depend.com
  • #95: www.depend.com
  • #96: www.depend.com
  • #97: www.depend.com