Introducing Entropy, a Pythonic Wallpaper Rater

March 20, 2014

Finding a good wallpaper is hard. The subject is, well, subjective. There are endless possibilities for the subject of the image: Sports cars, beautiful women, scenic vistas, cartoons, minimalistic patterns, and humorous/motivational quotes are all fantastic candidates. Rating the subject is best left to humans, but the machine can be manipulated to rate the image from a scientific standpoint.

To that end, we have released Entropy, a command-line tool to rate an image. Images are passed-in via a URL or file path. The image is assessed using features from the Pillow library, an excellent staple of Python’s community. We convert the image to Lab color and assess the individual L, a, and b values, per-pixel. An image with mostly warm pixels will get a higher rating than an image with few or no warm pixels. This logic stems from the Kruithof curve, which shows that there is a wider range of “pleasing” colors at higher luminance levels, so higher luminance + warmness means a higher rating. Below is the terminal output for a picture of an adorable little pug.


Picture resized. If you want the full-size, use Google Reverse Image Search.


Not bad, pup!

It could be argued that this isn’t the best way to determine an image’s aesthetic quality. It’s probably not, because humans are much better at rating that sort of thing. But it can help give a general sense of how you might feel repeatedly seeing the image. To that end, we also factor in size and aspect ratio differences if they exist between the image and screen. An insanely beautiful image probably won’t do you any good if it’s 250×800, after-all.

Entropy is open-source and available on Github.

Leave a Reply

Your email address will not be published. Required fields are marked *