Main

  • Teams
  • Locations
  • This is Wolt
    • Our story
    • What we're building
    • Our culture
    • Wolt engineering
  • How we hire
    • Early careers
  • Blog
Job search
  • Teams
  • Locations
  • This is Wolt
    • Our story
    • What we're building
    • Our culture
    • Wolt engineering
  • How we hire
    • Early careers
  • Blog
Job search

Tech

Dag Ågren

Jul 1, 2019

How we came to create a new image placeholder algorithm, BlurHash

Blushash

BlurHash is a compact representation of a placeholder for an image. Read on as our iOS Engineer Dag Ågren tells the story of how we came to create it!

Here’s the problem: You have designed and implemented a beautiful new way to browse your content, full of colourful images that really catch the eye. It is a beautiful, perfect gem. But you’ve been testing it on your nice and fast internet connection. As soon as you try to show it to your designer on your phone the internet hiccups and you are stuck staring at a page of bland, grey and empty boxes, with bits of text forlornly scattered around. Your designer starts crying at what you did with all his hard work.

“I could not let go of this, though, and could not shake the feeling that there should exist a good solution to this dilemma.”

Not a big problem, you think, recalling that some people have dealt with this problem by taking highly compressed, tiny thumbnails of their images, including them in their server data, scaling them up and blurring them to use as placeholders. You only need to add maybe a few hundred bytes of data for each one if you use every trick in the book! You tell your database engineer about this plan, and now he is crying because you want to stuff all this binary gunk into his beautifully designed and optimised database schema.

I may exaggerate slightly, but this is essentially what happened to me at my first project at Wolt. It was our new Discover tab, which was to be the new face of our application from there onwards. I had to admit that everyone involved had good points, and I had no solution that pleased everyone. I could not let go of this, though, and could not shake the feeling that there should exist a good solution to this dilemma.

“This turned out to be a good guess, and with a few tweaks I eventually got something that looked good. I spent about two days on this initial implementation.”

So once the project was otherwise ready for release I sat down to do some experiments with a few ideas I had. I figured all that was needed for a good-looking placeholder is a handful of colours, if presented in a pleasing way. One option would be to just encode a small number of pixels and scale them up smoothly. The second step can be tricky to get right, though.

In-text CTA - engineering

So what I decided to try was, in a sense, to combine the data representation with the presentation by using a DCT (Discrete Cosine Transform), the same representation used internally by formats like JPEG. It is both good for lossily compressing data, a big plus for this project, and the cosine functions it uses turns out to produce some pleasantly smooth gradients in the resulting image. This turned out to be a good guess, and with a few tweaks I eventually got something that looked good. I spent about two days on this initial implementation. (If you are curious about all the technical details, check out the repo at GitHub, which contains much more detailed explanations!)

blurhash-app

The DCT scheme combined with a custom encoding to ASCII characters that are easy to store in any database or server response, was enough to create aesthetically pleasing images using only 20-30 characters of text, an amount small enough to make everybody happy. It was quickly rolled out into the backend code and all of our different client applications now use these hashes while waiting for the real images to load. This was helped by the fact that the code for the algorithm ended up being quite simple, short, and could easily be ported to new languages.

It’s been tweaked and improved a few times since and we now finally had the time to put it together into an actual open-source project! So:

  • You can play around with it yourself and see how it looks at our demo site: blurha.sh

  • You can grab the source code in various languages at the official repo: github.com/woltapp/blurhash

  • And we are of course hiring: wolt.com/jobs

If you’re a programmer we’d love to see you use this in your own projects! We’d also love to see it ported to new programming languages, or used in new and creative ways. The code is very short and simple, so feel free to play around with it. If you have a good improvement you want to include in the official project, feel free to file a PR. Or just publish your own. We hope you star the repo and enjoy it!


Want to join our team to build Wolt together? We’re hiring! Check out our open roles at wolt.com/jobs 🚀

Interested in joining us?

Senior FullStack FrontEnd Engineer
Engineering•Tallinn, Estonia
Senior Android Engineer, Consumer Mobile Platform
Engineering•Berlin, Germany
Staff Engineer
Engineering•London, United Kingdom
Android Engineer, Consumer Discovery Team
Engineering•Helsinki, Finland•Berlin, Germany
See all open roles
Related articles
On-Call at Scale: How we do on-call engineering at Wolt
Behind the scenes of Wolt Hackathon 2023
Launching and revamping one of Wolt’s most beloved features
Follow our tech team on XGet updates about our next meetups, tech blogs, open positions and more.Follow our tech team on XSubscribe to our Wolt Tech Talks YouTube channelTune in for interesting tech talks from our product teams.Subscribe to our Wolt Tech Talks YouTube channelFollow us on LinkedInStay in touch with the latest news, content and job opportunities from Wolt.Follow us on LinkedIn
Author: Dag

Dag Ågren

iOS Engineer at Wolt

Read next

Firefighter Yuho

Tech

On-Call at Scale: How we do on-call engineering at Wolt

Ibbad Hafeez, SRE Competence Lead & Helena Anttila, Head of Tech Support

Jan 16, 2024
Hackathon 2023

Tech

Behind the scenes of Wolt Hackathon 2023

Leandro Storoli dos Santos

Jul 5, 2023
easter-egg-game-blog-hero-1.webp

Design

Launching and revamping one of Wolt’s most beloved features

Mia Lavanti

Nov 25, 2022
How to develop quality products - alt image

Tech

How to develop quality products

Untamo Hirvonen, QA Competence Lead at Wolt

May 26, 2023
Cover image: open source blog

Tech

Wolt loves open-source software

Fredrik Sannholm

Aug 24, 2022
new

Tech

How our engineering teams prepare for scalability events at Wolt

Ibbad Hafeez

Mar 21, 2024
Ada Blank

Tech

From biotech to Python with Ada — the journey of a software engineer

Apr 6, 2023
Cover image: python packages

Tech

Introducing a project template for modern Python packages

Jerry Pussinen

Aug 11, 2022
Join us!

Discover all 337 opportunities at Wolt

    • Teams
    • Locations
    • This is Wolt
    • How we hire
    • Blog
    • For couriers
    • For merchants
    • For stores
    • For companies
    • For Wolt Delivery
    • Contact
    • Media
    • Support
    • Responsibility
    • Security
    • Instagram
    • Facebook
    • Twitter
    • LinkedIn
Get it on the App StoreGet it on the App StoreGet it on Google PlayGet it on Google Play

Wolt Careers

  • Teams
  • Locations
  • This is Wolt
  • How we hire
  • Blog

Let's do this together

  • For couriers
  • For merchants
  • For stores
  • For companies
  • For Wolt Delivery

Wolt links

  • Contact
  • Media
  • Support
  • Responsibility
  • Security

Follow us

  • Instagram
  • Facebook
  • Twitter
  • LinkedIn
Get it on the App StoreGet it on the App StoreGet it on Google PlayGet it on Google Play
Accessibility statementTerms and conditions

© Wolt 2014-2026