Apps should be more colorful! 🌈 This is one of my favorite tricks from Dream Machine - for just +75 bytes you get beautiful colors, animatable gradients and super fasts blurs 😊 (1/6)
Only thing you need is to store a 5x5 downsampled version of every image alongside its metadata (url, size, etc.). For 8bit/channel it's just 25 * 3 = 75 bytes (2/6)
1
21
The first unlock you get get is that you'll never need placeholders again while your assets are loading! This feels great, especially on slower networks, since you can basically navigate your library even if things haven't loaded using colors as landmarks :) (3/6)

Aug 17, 2025 · 7:46 PM UTC

1
21
0
You can basically upsample the 5x5 and get a good approximation of the full resolution blur before your asset has even downloaded. This is great for image placeholders, detail backgrounds, glows, etc. + you avoid a lot of heavy blur passes which can really tank performance in dense media galleries. (4/6)
2
1
2
18
If you only want dominant colors - just do a quick k-means on the 25 pixels, add some contrast, and get a pretty good color palette 🎨 You can run the same algorithm on groups of images and use the output to influence your shaders 🧑‍🎨 (5/6)
1
2
30
0
Final - and my personal favorite - make the 5x5 image Animatable and now SwiftUI can smoothly animate your backgrounds, with 0 blurs or ugly crossfades. Bonus: add some swirls in there and get yourself some Apple Music backgrounds 🎛️ That's all, beauty in simplicity! (6/6)
1
42
0