dithering experiments

By rra
Category: log

One of the challenges of self-hosting websites comes with the fact that one often deals with an ADSL connection. These Asynchronous Digital Subscriber Lines made it possible for many home subscribers to get access to high speed internet but with a catch.

The asynchronicity means download speeds are much higher than the upload speeds. One can see this in the way speeds are advertised: 50/10mbps.

Essentially that means that a self-hosted website will often be slow, compared to a website hosted in a datacenter.

This is especially the case when it comes to heavy websites with a lot of images.

This lead me to explore some ways to compress the images and lead me to try out dithering techniques.

Using pillow, the python imaging library and hitherdither, an extension for it allowing for finegrained dithering, I made a script to compare different techniques and palettes.

The basic way dithering works as an image compression is through reducing the number of colors displayed. The dithering algorithms themselves then try to approximate the luminosity by creating patterns made up of colors in the limited color palette that approximate the intensity.

dithering.html Tue 12 Nov 2019 03:52:15 PM CET 3.863KB