SlideShare a Scribd company logo
Delivering Beautiful and Fast
Images and Video
Doug Sillars
@DougSillars
Devoxx Belgium
November 15, 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
Devoxx be fast and beautiful images
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
7.9 MB
3.5 MB
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
Devoxx be fast and beautiful images
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 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
Mobile era fastandbeautiful
PPTX
Notts js fastandbeautiful
PPTX
Bordeaux js fastandbeautiful
PPTX
Perf ug fastandbeautiful
PPTX
Devfest Siberia Fast and Beautiful Images and Video
PPTX
Parisjs fastvideoandimages
PPTX
Ux connect london_fastandbeautiful
PPTX
Beautiful and Fast Images
Mobile era fastandbeautiful
Notts js fastandbeautiful
Bordeaux js fastandbeautiful
Perf ug fastandbeautiful
Devfest Siberia Fast and Beautiful Images and Video
Parisjs fastvideoandimages
Ux connect london_fastandbeautiful
Beautiful and Fast Images

What's hot (20)

PPTX
Waterford fast images
PPTX
Fast and Beautiful Images and Video
PPTX
Cork ux Meetup
PPTX
Imagesandvideo stockholm webmeetup
PPTX
Imagesandvideo stockholm fastandbeautiful
PPTX
Hamburg web perf meetup
POTX
Its timetostopstalling cambridgemot
PPTX
Cologne webperf
PPTX
Webcamp fastandbeautiful
POTX
Its timetostopstalling londroid
PPTX
Fast and Beautiful Images: DublinJS
POTX
Its timetostopstalling barcelonajs
POTX
Its timetostopstalling sw_mobile_bristol
POTX
Its timetostopstalling limerick
PPTX
PyconUK: Fast and Beautiful Images
PPTX
Imagesandvideo voxxeddays
POTX
Mobile web perf Amsterdam Tech Tips
PPTX
Its Time To Stop Stalling: Mobile App and Video Performance
PPTX
Its timetostopstalling pentabar
POTX
Mobile App Performance, Dublin MOT
Waterford fast images
Fast and Beautiful Images and Video
Cork ux Meetup
Imagesandvideo stockholm webmeetup
Imagesandvideo stockholm fastandbeautiful
Hamburg web perf meetup
Its timetostopstalling cambridgemot
Cologne webperf
Webcamp fastandbeautiful
Its timetostopstalling londroid
Fast and Beautiful Images: DublinJS
Its timetostopstalling barcelonajs
Its timetostopstalling sw_mobile_bristol
Its timetostopstalling limerick
PyconUK: Fast and Beautiful Images
Imagesandvideo voxxeddays
Mobile web perf Amsterdam Tech Tips
Its Time To Stop Stalling: Mobile App and Video Performance
Its timetostopstalling pentabar
Mobile App Performance, Dublin MOT
Ad

Similar to Devoxx be fast and beautiful images (17)

PPTX
Imagesandvideo tallinn
POTX
Mobile App Performance, Firenze
PPTX
Fastandbeautiful belfast
PPTX
Mcr fredfastvideoandimages
PPTX
Fast and Beautiful Images: PyConWeb
PPTX
Reading gdg images
PPTX
Milano ux
PPTX
Fastandbeautiful vienna
PPTX
Fastandbeautiful devfest london
PPTX
Turin webperf meetup
POTX
Its Time To Stop Stalling Bucharest
PPTX
Fastandbeautiful zagrebtechsauna
POTX
Its time to stop stalling novi sad
POTX
Its timetostopstalling androidcork
PPTX
Stop Stalling: Video Delivery Best Practices
POTX
Its timetostopstalling gdgdusseldorf
POTX
Its timetostopstalling swp_munich
Imagesandvideo tallinn
Mobile App Performance, Firenze
Fastandbeautiful belfast
Mcr fredfastvideoandimages
Fast and Beautiful Images: PyConWeb
Reading gdg images
Milano ux
Fastandbeautiful vienna
Fastandbeautiful devfest london
Turin webperf meetup
Its Time To Stop Stalling Bucharest
Fastandbeautiful zagrebtechsauna
Its time to stop stalling novi sad
Its timetostopstalling androidcork
Stop Stalling: Video Delivery Best Practices
Its timetostopstalling gdgdusseldorf
Its timetostopstalling swp_munich
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
Ai powered images-opieaivienna
PPTX
A rt gallery devfestlondon
PPTX
A rt gallery cardiff
PPTX
Ai powered images-mobileera
PPTX
Fastandbeautiful oredev
PPTX
A rt gallery oredev
PPTX
A rt gallery webcamp-zg
PPTX
Qa fest kiev_when its just too slow
PPTX
A rt gallery coding-serbia_novisad
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
Ai powered images-opieaivienna
A rt gallery devfestlondon
A rt gallery cardiff
Ai powered images-mobileera
Fastandbeautiful oredev
A rt gallery oredev
A rt gallery webcamp-zg
Qa fest kiev_when its just too slow
A rt gallery coding-serbia_novisad

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Chapter 3 Spatial Domain Image Processing.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
cuic standard and advanced reporting.pdf
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Review of recent advances in non-invasive hemoglobin estimation
MYSQL Presentation for SQL database connectivity
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

Devoxx be fast and beautiful images

Editor's Notes

  • #25: 47% smaller!
  • #31: 1149 bytes, 700 Zipped
  • #32: 1149 bytes, 700 Zipped
  • #33: 1149 bytes, 700 Zipped
  • #34: 1149 bytes, 700 Zipped
  • #35: 1149 bytes, 700 Zipped
  • #39: 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