995 Bonus: Images [1.5d]

Posted Over 8 years ago. Visible to the public.

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>
  • Ignore the issue

Discuss the pros and cons of each approach with your mentor.

Resources

Exercises

  1. Add a logo image to MovieDB. The logo image should look unpixelated on both high- and low-density displays.
  2. 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)
Henning Koch
Last edit
9 months ago
Michael Leimstädtner
Keywords
retina
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra Curriculum (2015-09-09 06:38)