SlideShare a Scribd company logo
Delivering Fast and Beautiful Images
Doug Sillars
@DougSillars
Edinburgh React
February 6, 2019
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
Edi react 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 make up 50% 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)
KB
Original 946
Optimized 1
Scalable Vector Graphics (SVG)
KB
Original 946
Optimized 1
Scalable Vector Graphics (SVG)
KB
Original 946
Optimized 1
GZip 687 bytes
Scalable Vector Graphics (SVG)
KB
Original 946
Optimized 1
GZip 687 bytes
Brotli 525 bytes
Scalable Vector Graphics (SVG)
KB
Original 946
Optimized 1
GZip 687 bytes
Brotli 525 bytes
Scalable Vector Graphics (SVG)
<style >
.svgorange {
filter: invert(.5) sepia(1)
saturate(5) hue-rotate(5deg);
}
</style>
<img class="svgorange" src ="map-
marker-circle.svg">
https://medium.com/@union_io/swapping-fill-color-on-image-tag-svgs-using-css-filters-fa4818bf7ec6
Scalable Vector Graphics (SVG)
Image Formats – Average Size
HTTPArchive mobile websites 15/02/18
File Format: WebP
https://caniuse.com/#feat=webp
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 Processing
1M
pixels
Download (s) Image Decode
(ms)
Desktop 14 78
Moto G4 14.2 218
Alcatel 1X 14.2 820
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: Chrome Experiments
Lazy Loading: Chrome 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
Addendum: What Are Your Customers Saying?
Addendum: Save-Data
Save-Data: on
Addendum: Save-Data
Addendum: Save-Data
Addendum: Save-Data
Addendum: Save-Data
q_auto -> q_auto:eco
180KB -> 135 KB
https://res.cloudinary.com/dougsillars/image/upload/w_1400,q_auto/v1540978150/IMG_20181028_153301_okeb2b.jpg
Addendum 2: Network Info
Addendum 2: Network Info
// Network type that browser uses
navigator.connection.type;
// Effective bandwidth estimate
navigator.connection.downlink
// Effective round-trip time estimate
navigator.connection.rtt
// Upper bound on the downlink speed of the first network hop
navigator.connection.downlinkMax
Addendum 2: Network Info
// Network type that browser uses
navigator.connection.type;
// Effective bandwidth estimate
navigator.connection.downlink
// Effective round-trip time estimate
navigator.connection.rtt
// Upper bound on the downlink speed of the first network hop
navigator.connection.downlinkMax
500 KBPS
Addendum 3: Base 64 Encoding
Images embedded as Base64 in your HTML/CSS/JS
• Fewer Requests
• Images Now Block Rendering of Page
• Images are 20-30% larger
• Caching is limited
• Difficult to reference more than once
https://calendar.perfplanet.com/2018/performance-anti-patterns-base64-encoding/
Addendum 3: Base 64 Encoding
• 91KB CSS Shared as University Template
• 48KB is SVG
• Never Appears on Any Page
Departments, colleges and other units of
the University of Nebraska–Lincoln should
use the Nebraska N as a main identifier,
not the University seal, on all publications,
invitations, websites and other electronic
media.
https://unlcms.unl.edu/wdn/templates_4.1/css/all.css?dep=4.1.36
Addendum 3: Base 64 Encoding
https://cdn.glowing.com/generated/css/base.474240e8485dbff13fd3652d24ef83bc.css
Conclusion
Optimize Image:
Quality
Format
Sizing
Lazy Load if Possible
aGIFs to movies
No Base64 Encoded Images
Monitor Customer’s headers
Images
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 CAN Be Beautiful AND Fast
Addendum 3: Base64 Encoded Images
Fewer Requests *can* be better
Images in CSS place Images in the Critical Rendering path
Hardcoding images as text increases size by 20-30%
Edi react fastandbeautiful

More Related Content

PPTX
Fastandbeautiful gdgtartu
PPTX
Fastandbeautiful gdgtallinn
PPTX
Imagesandvideo voxxeddays
PPTX
Snowcamp fastandbeautiful
PPTX
Fastandbeautiful zagrebtechsauna
PPTX
Fastandbeautiful devdayseu
PPTX
Fastandbeautiful mobilewarsaw
PPTX
Fastandbeautiful vienna
Fastandbeautiful gdgtartu
Fastandbeautiful gdgtallinn
Imagesandvideo voxxeddays
Snowcamp fastandbeautiful
Fastandbeautiful zagrebtechsauna
Fastandbeautiful devdayseu
Fastandbeautiful mobilewarsaw
Fastandbeautiful vienna

What's hot (20)

PPTX
Fastandbeautiful chemnitz
PPTX
Fastandbeautiful yglf
PPTX
Fastandbeautiful full stacklondon
PPTX
Fastandbeautiful novi sad
PPTX
Fastandbeautiful ux wurzburg
PPTX
Fastandbeautiful oredev
PPTX
Fastandbeautiful full stackporto
PPTX
Fastandbeautiful porto
PPTX
Fastandbeautiful dublin php
PPTX
Fastandbeautiful devfest london
PPTX
Fastandbeautiful krakow
PPTX
Fastandbeautiful full stacklondon
PPTX
Fastandbeautiful belgrade
POTX
Mobile App Performance, Dublin MOT
POTX
Its timetostopstalling limerick
PPTX
Fastandbeautiful gdg sacremento
PPTX
Fastandbeautiful seattlevue
PPTX
Fastandbeautiful gd glittlerock
PPTX
Fastandbeautiful seattle css
PPTX
Imagesandvideo tallinn
Fastandbeautiful chemnitz
Fastandbeautiful yglf
Fastandbeautiful full stacklondon
Fastandbeautiful novi sad
Fastandbeautiful ux wurzburg
Fastandbeautiful oredev
Fastandbeautiful full stackporto
Fastandbeautiful porto
Fastandbeautiful dublin php
Fastandbeautiful devfest london
Fastandbeautiful krakow
Fastandbeautiful full stacklondon
Fastandbeautiful belgrade
Mobile App Performance, Dublin MOT
Its timetostopstalling limerick
Fastandbeautiful gdg sacremento
Fastandbeautiful seattlevue
Fastandbeautiful gd glittlerock
Fastandbeautiful seattle css
Imagesandvideo tallinn
Ad

Similar to Edi react fastandbeautiful (13)

PPTX
Fastandbeautiful webinale
PPTX
Imagesandvideo stockholm fastandbeautiful
PPTX
Fastandbeautiful belfast
PPTX
Imagesandvideo stockholm webmeetup
PPTX
Edi ux fastandbeautiful
PPTX
Reading gdg images
PPTX
Turin webperf meetup
PPTX
Hackference
PPTX
Milano ux
PPTX
Fast and Beautiful Images: PyConWeb
PPTX
Mcr fredfastvideoandimages
PPTX
OSCAL: Free and Open Source Tools for Image and Video Performance
PPTX
Oggcamp Fast and Beautiful Images
Fastandbeautiful webinale
Imagesandvideo stockholm fastandbeautiful
Fastandbeautiful belfast
Imagesandvideo stockholm webmeetup
Edi ux fastandbeautiful
Reading gdg images
Turin webperf meetup
Hackference
Milano ux
Fast and Beautiful Images: PyConWeb
Mcr fredfastvideoandimages
OSCAL: Free and Open Source Tools for Image and Video Performance
Oggcamp Fast and Beautiful Images
Ad

More from Doug Sillars (20)

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
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
PPTX
Armadajs video
PPTX
Belgrade when its just too slow
PPTX
Ai powered images-geneva
PPTX
A rt gallery limerick-galway
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
A rt gallery oredev
A rt gallery webcamp-zg
Qa fest kiev_when its just too slow
A rt gallery coding-serbia_novisad
Armadajs video
Belgrade when its just too slow
Ai powered images-geneva
A rt gallery limerick-galway

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
KodekX | Application Modernization Development
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Big Data Technologies - Introduction.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
KodekX | Application Modernization Development
Diabetes mellitus diagnosis method based random forest with bat algorithm
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Cloud computing and distributed systems.

Edi react fastandbeautiful

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
  • #36: 1149 bytes, 700 Zipped
  • #37: 1149 bytes, 700 Zipped
  • #38: 1149 bytes, 700 Zipped
  • #39: 1149 bytes, 700 Zipped
  • #40: 1149 bytes, 700 Zipped
  • #41: 1149 bytes, 700 Zipped
  • #44: 47% smaller! Or 65% smaller from original!
  • #70: file:///Users/demo/Documents/reponsiveimages.html