Am Sagarwala
Associate Dean, Interaction Design @ Humber College. Proprietor @ Artform.ca
.wrapper {
display: grid;
grid-template-columns:
1fr
min(65ch, 100%)
1fr;
}
.wrapper > * {
grid-column: 2;
}
.full-bleed {
width: 100%;
grid-column: 1 / 4;
}Several challenges associated with using formats:
Automation can make it seamless:
# Encode JPEG to AVIF with default settings
avif -e cat.jpg -o kitty.avif
# Encode PNG with slowest speed
avif -e dog.png -o doggy.avif --best -q 15
# Lossless encoding
avif -e pig.png -o piggy.avif --losslessUsing go-avif
<picture>
<source srcset="img/photo-mobile.avif" type="image/avif" media="(max-width:650px)">
<source srcset="img/photo-mobile.webp" type="image/webp" media="(max-width:650px)">
<source srcset="photo-mobile.jpg" media="(max-width:650px)">
<source srcset="img/photo-desktop.avif" type="image/webp" media="(min-width:651px)">
<source srcset="img/photo-desktop.webp" type="image/webp" media="(min-width:651px)">
<img src="img/photo.jpg" alt="Description of Photo">
</picture>
What other techniques are you aware of?
Optimization opportunities exist at every stage of a request
Image: Mozilla MDN
Use HTTP/2 or SPDY
Image: Yoast
By Am Sagarwala
Image formats, optimization, and analyzing page speed.
Associate Dean, Interaction Design @ Humber College. Proprietor @ Artform.ca