Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Responsive Images using <picture> and srcset/sizes
Search
Matt Steele
July 02, 2014
Programming
1.4k
1
Share
Responsive Images using <picture> and srcset/sizes
Matt Steele
July 02, 2014
More Decks by Matt Steele
See All by Matt Steele
Upgrading to Angular 2 using ngUpgrade
mattdsteele
0
1.1k
Reactive Programming with RxJS
mattdsteele
0
120
GET TO THE CHOPVAR
mattdsteele
0
190
Using Source Maps in 2015
mattdsteele
0
1k
The Decorator Pattern
mattdsteele
0
83
Diving Into the Device API
mattdsteele
1
840
Unit Testing JavaScript when you're Afraid of JavaScript
mattdsteele
3
780
What Zelda Taught Me about Front End Engineering
mattdsteele
5
1.1k
Other Decks in Programming
See All in Programming
JOAI2026 1st solution - heron0519 -
heron0519
0
120
AIエージェントで業務改善してみた
taku271
0
520
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
170
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
780
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
330
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
1
330
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
1
160
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
350
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.5k
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
440
Exploring RuboCop with MCP
koic
0
510
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
910
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
69
38k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
A Tale of Four Properties
chriscoyier
163
24k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
710
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
Everyday Curiosity
cassininazir
0
190
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
890
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Transcript
Responsive Images @mattdsteele
THIS IS WHY YOU’RE FAT
We’ve put on a little weight.
http://httparchive.org/trends.php#bytesTotal&reqTotal
http://httparchive.org/trends.php#bytesTotal&reqTotal Total Page Weight File Size (KB) 1400 1550 1700
1850 July August September October NovemberDecember January February March April May June
http://httparchive.org/trends.php#bytesTotal&reqTotal Total Page Weight File Size (KB) 1400 1550 1700
1850 July August September October NovemberDecember January February March April May June 1485kb 1521kb 1551kb 1590kb 1614kb 1701kb 1681kb 1710kb 1728kb 1762kb 1775kb 1808kb
http://httparchive.org/interesting.php Bytes Per Page by Content Type
http://httparchive.org/interesting.php Images Bytes Per Page by Content Type
http://httparchive.org/interesting.php HTML Other Flash Stylesheets Scripts Images Bytes Per Page
by Content Type
RETINA- POCALYPSE
None
iPhone 3GS
320x480 iPhone 3GS
320x480 iPhone 3GS iPhone 4
320x480 640x960 (2x) iPhone 3GS iPhone 4
HTC One
1920x1080 (3x) HTC One
“Let’s make it responsive!”
Nexus 10
2560x1600 (2x) Nexus 10
2880x1800 (1.6x) MacBook Pro with Retina Display
None
None
None
320x213 41kb
320x213 41kb
320x213 41kb 640x425 137kb
None
1280x852 400kb
72% Responsive sites serve the same content to desktop &
mobile http://www.guypo.com/uncategorized/real-world-rwd-performance-take-2/
Ugh.
Shortcut: <SVG>
<img src="logo.svg">
9+ SVG
Grunticon github.com/filamentgroup/grunticon
"Vectors are for chumps. I need bitmaps."
None
<picture>
<picture> <img src="fallback.png"> </picture>
<picture> <source media="(min-width: 1000px)" srcset="large.png"> <source media="(min-width: 640px)" srcset="medium.png"> <img
src="fallback.png"> </picture>
<picture> <source media="(min-width: 1000px)" srcset="large.webp" type="image/webp"> <source media="(min-width: 1000px)" srcset="large.png">
<source media="(min-width: 640px)" srcset="medium.png"> <img src="fallback.png"> </picture>
None
None
None
Art Direction
<picture> 38 33 Under Consideration
None
None
Screen Size ⊆ What You Need
None
Viewport Size
Viewport Size Screen Density
Viewport Size Rendered Size Screen Density
Viewport Size Rendered Size Screen Density Image Dimensions
Viewport Size Rendered Size Screen Density Image Dimensions Browser knows?
Viewport Size Rendered Size Screen Density Image Dimensions Browser knows?
✓
Viewport Size Rendered Size Screen Density Image Dimensions Browser knows?
✓ ✓
Viewport Size Rendered Size Screen Density Image Dimensions Browser knows?
✓ ✓ ✗
Viewport Size Rendered Size Screen Density Image Dimensions Browser knows?
✓ ✓ ✗ ✗
Viewport Size Rendered Size Screen Density Image Dimensions
Viewport Size Rendered Size Screen Density Image Dimensions Author knows?
Viewport Size Rendered Size Screen Density Image Dimensions Author knows?
✗ ✗ ✓ ✓
srcset & sizes
Image dimensions srcset="large.jpg 1200w, medium.jpg 640w, small.jpg 320w"
Image dimensions URL srcset="large.jpg 1200w, medium.jpg 640w, small.jpg 320w"
Image dimensions Width URL srcset="large.jpg 1200w, medium.jpg 640w, small.jpg 320w"
Rendered Size sizes="(min-width: 1024px) 300px, (min-width: 640px) 50vw, 100vw"
Rendered Size For this MQ: sizes="(min-width: 1024px) 300px, (min-width: 640px)
50vw, 100vw"
Rendered Size For this MQ: Image renders this big sizes="(min-width:
1024px) 300px, (min-width: 640px) 50vw, 100vw"
Rendered Size For this MQ: Image renders this big Default
sizes="(min-width: 1024px) 300px, (min-width: 640px) 50vw, 100vw"
<img src="small.jpg" alt="A responsive image" srcset="large.jpg 1200w, medium.jpg 640w, small.jpg
320w" sizes="(min-width: 1024px) 300px, (min-width: 640px) 50vw, 100vw">
Screen Densities
Configurable
Configurable •HD Mode
Configurable •HD Mode •Speed Mode
Configurable •HD Mode •Speed Mode •Crappy Network Mode
srcset 32 Under Consideration
Fallbacks built-in
Or: Picturefill http://scottjehl.github.io/picturefill/
Go Forth And Get Skinny
@mattdsteele flic.kr/p/7TH4dc