1.06 GB of wallpapers, 27 KB on screen

From source to derivative to the bytes on screen: measuring an image pipeline.

The sources behind the forty-two wallpapers are 5760x4096 PNGs, each between 10 and 42 MB, 1.06 GB in total, and none of them is committed. What enters the repository are the derivatives: forty-two AVIF files at 2560 pixels wide and quality 50, 5.60 MB together, the smallest 16 KB, the median 125 KB, the largest 406 KB. The calibration was done on a single 32 MB source: AVIF at quality 50 gives 246 KB at 2560 pixels and 545 KB at 3840, AVIF at quality 62 gives 434 KB, WebP at quality 78 gives 447 KB. On that file, in other words, a 2560 pixel AVIF is a 130x reduction. A second 1280 pixel variant was considered and rejected: it would add 1.86 MB, and the cover-sizing arithmetic showed that the phone demands more pixels than the desktop, 3561 device pixels against 3024, so it would have been a drop in quality rather than a saving.

The darkening layer, and what the picker costs

All forty-two need a darkening layer for white text to reach 4.5:1. The highest is 0.54, the lowest non-zero one is 0.21, the median is 0.51, and the number that pass without one is zero. One consequence shows up in the wallpaper picker, where the thumbnails are deliberately left undarkened, because telling forty-two abstract colour fields apart under a median 51 per cent black overlay would be impossible. The picker is a measurement in its own right: printing all forty-two at full size comes to 5 874 095 bytes, while going through next/image with a 96 pixel size hint costs 27 766 bytes, which is 212 times cheaper, measured with sharp 0.35.3, the same encoder the optimizer runs. The limit belongs next to it: 27 KB holds only at the first pixel density, the second costs 121 260 bytes and the third costs 290 004, though both stay an order of magnitude below the background-image route. The second number that belongs beside the headline is the srcset markup, 41 130 bytes, more than the real image bytes, and it never goes over the network.

Tags

  • Performance
  • Accessibility
1.06 GB of wallpapers, 27 KB on screen · Deniz Barış Yıldırım, Portfolyo OS