

<img src="example.png"> <!-- it'll be requested -->
@media (max-width: 480px) {
img {
display: none;
}
}
<body>
<section class="section-1">
<p>This is the current section</p>
<img src="example-1.png">
</section>
<section class="section-2 hidden">
<p>This section might or might not be shown later</p>
<img src="example-2.png"> <!-- it'll be requested -->
</div>
</body>
.hidden {
display: none;
}
Illustration from WHATWG HTML spec
<img sizes="(max-width: 30em) 100vw,
(max-width: 50em) 50vw,
calc(33vw - 100px)"
srcset="swing-200.jpg 200w,
swing-400.jpg 400w,
swing-800.jpg 800w,
swing-1600.jpg 1600w"
src="swing-400.jpg" alt="Kettlebell Swing">
<figure>
<div>
<div/> <!-- this div keeps the aspect ratio so
the placeholder doesn't collapse -->
<img/> <!-- this is a tiny image with a small
resolution (e.g. ~27x17) and low quality -->
<canvas/> <!-- takes the above image and applies a blur filter -->
<img/> <!-- the large image to be displayed -->
<noscript/> <!-- fallback for no JS -->
</div>
</figure>
Did @Medium recently add a new image loading fade-in? I noticed it this morning on mobile and just now again on web. Looks nice.
— Jason (@lang) February 29, 2016
@Medium's articles (although full of high-res images) load up very fast *-*
— DobaKung (@zartre) March 28, 2015
I don't know about you but I don't like a bit those blurry (still loading...) images on Medium. Very distracting.
— Harris Rodis (@harrisrodis) December 29, 2015
That blurry image preloading thing on Medium - is it just me or does it make all images load extremely slowly now?
— James Young (@welcomebrand) February 5, 2016
With the Progressive JPEG method [...] cognitive fluency is inhibited and the brain has to work slightly harder to make sense of what is being displayed.
— From Progressive image rendering: Good or evil?
I'm seeing this more and more on Medium posts. Maybe the whole "blur the pictures" stuff isn't a good idea… pic.twitter.com/X8wLBDHHFw
— Damien Erambert (@Eramdam) January 8, 2016
This @Medium page is fully loaded on my slow connection. Very pretty with those stupid image effects, isn’t it? pic.twitter.com/kLwlyWRLhc
— Sara Soueidan (@SaraSoueidan) November 28, 2015
Unfortunately, the standard JPEG header is hundreds of bytes in size. In fact, the JPEG header alone is several times bigger than our entire 200-byte budget. However, excluding the JPEG header, the encoded data payload itself was approaching our 200 bytes.
Header (mainly Quantization Table and Huffman Table) | Compressed Data |
Client (mobile app) | GraphQL |
Canny Edge Detector
<svg>
<polyline points="51,1 61,1 61,2 56,4 56,3"/>
<polyline points="52,1 50,2 51,3 50,4 50,9 46,10 46,8 48,8 48,9"/>
<polyline points="61,4 61,5 58,6"/>
...
<polyline points="62,58 61,59 61,60 50,62 50,61 51,61"/>
</svg>
Just because you can it doesn't mean you should