Learn
Image formats
- Understand the difference between raster images (like
.png
) and vector images (like.svg
). - Understand why a print designer talks a lot about physical measurements like "cm" and "DPI" and why this rarely matters to us.
- Understand how JPEG compression degrades the image quality every time you save the file.
- Understand the strengths and weaknesses of the following file formats:
png
webp
gif
jpg
svg
High density displays
Browse the internet in order to:
- Understand the distinction between virtual pixels vs. physical pixels.
- Understand how raster images prepared for a 1:1 pixel ratio look like on high density displays.
- Understand which classes of devices typically have high-density displays (Smartphones, Macs) and which don't (most PCs, cheap phones, TVs).
Since we rarely know which device will be displaying our applications, we need to deal with both.
Browse the internet and get familiar with the following ways to embed raster images for high-density displays:
- Always embed images in larger resolution
- Use vector graphics
- Create multiple sizes of the image
- Use media queries that test for
min-device-pixel-ratio
- Use
<img srcset="...">
- Use
<picture>
- Use media queries that test for
- Ignore the issue
Discuss the pros and cons of each approach with your mentor.
Resources
- Images done right Show archive.org snapshot
- HTML Standard Show archive.org snapshot
- A collection of 300.000+ SVG Vectors and Icons Show archive.org snapshot
- MDN: Responsive Images Show archive.org snapshot
- img srcset und sizes Show archive.org snapshot 🇩🇪
- Halve the size of images by optimising for high density displays Show archive.org snapshot
Exercises
- Add a logo image to MovieDB. The logo image should look unpixelated on both high- and low-density displays.
- Add icons to the menu items of MovieDB. Integrate
Feather
Show archive.org snapshot
for this.
You might need such a compiler to activate the icons:
import feather from 'feather-icons'
up.compiler('[data-feather]', feather.replace)
Posted by Henning Koch to makandra Curriculum (2015-09-09 06:38)