Eco-design: a tool to compare image formats

The Akiani team during the eco-design training session.
Author Sami Lini
Date 19 November 2024
Reading time 5 minutes

Values, CSR and not B-Corp

Social values have always been an important part of our model. The last few years have shown us how much societal and environmental issues are also things the agency needs to take on. We have started various initiatives in that direction, which we’ve talked about to varying degrees, including a B-Corp certification on which we burned a lot of time and resources. And which we dropped because we felt we were doing CSR-washing and it didn’t make sense for us (thanks by the way to Noesya, sharing their thinking (opens in new window) finished convincing us). But it did have the virtue of making us question the direction we wanted to take (thanks Aurélia Cocheteux (opens in new window) for the support, it was useful as you can see).

Building up our internal skills was part of that. Because we no longer felt we could just rely on continuous improvement to build our skills.

So a couple of years ago we launched a slightly ambitious internal training programme, where the idea is to run 2 a year. Of course, between the ambition and the reality there is often a gap, but we manage to stick to it pretty well. And we have just come out of our second annual training of the year.

The Akiani team gathered around a table, focused on their laptops during the second day of training on eco-design.

Aligning and getting trained: accessibility and eco-design

Some training is just there to add new skills we can build on later. And we have training that not only feeds us on a technical level but also at the level of our values.

The first topic we wanted to train ourselves on was accessibility. It was fascinating, and it keeps feeding our thinking every day.

The second was eco-design (love, by the way, to our friends at Temesis (opens in new window), whom we have the joy of meeting on many projects, and whom we asked to run both training sessions).

Of course, these two topics don’t come out of nowhere. They have been at the heart of a lot of our thinking for some time now, and they are now at the heart of the thinking of many of our institutional clients, whose contracts we’re lucky enough to hold.

Among the (many) strong messages that came through in this training, two have a particular resonance: the question of image compression and the question of AI. Let’s start with the second one. AI is an environmental sinkhole, more or less everyone seems to agree. Some will no doubt find subtleties in the sinkhole, but it still seems that a sinkhole, subtle or not, is overall a sinkhole. That bothers us a bit. Because we pay more and more attention to our carbon footprint, we favour low-impact modes of transport, and so on; but we do use AI. Quite a lot, actually.

AI in the day-to-day

Our day-to-day use of AI at the agency is not for generating blog articles (you would have noticed), or for writing PowerPoint presentations for us. But we use it to generate code. Code that lets us optimise how we’re organised. Stop asking the team to do mind-numbing tasks, smooth out processes, avoid mistakes, save time and do better as often as possible.

In fact, it has become, to some extent, one piece of our CSR policy: making sure our team can focus its energy on tasks with real added value, not on dumb and pointless stuff.

A bit uncomfortable with the contradiction, then.

Eco-design and images

Let’s come back to the first message that struck a particular chord: the proper use of image formats. So that one is a topic that keeps coming up with our clients: what image resolution, what compression format, what compression rate, and so on. We first held the line of “less is more”. But that wasn’t very satisfying, especially when it comes to finding compromises. So we looked into the literature: between increasing the compression rate and reducing the resolution, which is more efficient in terms of file size? Between image formats, which are the most efficient? And we found no answer. The specialist partners we work with seemed to be asking themselves the same things. All other things being equal, what is the impact of changing the “resolution”, “compression rate” and “image format” criteria?

Thanks GPT?

So we went back to AI, for our favourite use of it: a Python script. Using GPT and a bit of time, we produced a small script that takes an uncompressed image (known as RAW), lowers its resolution (from 100% down to 20%, without touching the other parameters), modifies its compression setting (from 30 to 100, without touching the other parameters), and changes its format (jpg, webp, avif and jpg xl). And we asked it to plot the file-size curves for each situation.

The file-size curves for each situation for an image during the eco-design training. The curves show an exponential decrease in weight as a function of resolution, even more so as a function of compression rate, and contrasting, heterogeneous results when crossing compression percentage and file formats.

Since we figured that the choice of one specific image could influence the result, we then asked it to process a full folder and to display the averaged results. Then, as we started getting the hang of it, we asked it to generate an HTML interface that, for a given image, shows its file-size curves. You can also select a sample on the original photo and display it in all the formats we care about, to compare them visually. Because it’s all well and good to say “the file is small”, but if the compression looks awful, it can be a problem.

Preview of the interface to select a zone in the image and compare the compression results.

We were surprised by the results, but well, we are not eco-design or image compression experts, so it might be that the results are rubbish. So we make the Python script available so you can test it at home. It’s to be taken “as is” as our Anglo-Saxon friends say. There is no reason for it to damage anything at your end, but if it did, you’re grown-up and responsible. If you reach the conclusion that the code is comparing apples to pears, well, we’ll adjust to compare apples with apples. Or pears with pears, you get the idea. We’ll be interested in any case to hear what you think, and why not what results you get if it feels relevant.

There you go, it was long and twisty, you were warned.

Vous souhaitez discuter de votre projet ?

Tout le monde parle expérience utilisateur, design de service, ergonomie… C’est pas très clair, mais vous aimeriez bien découvrir tout ça ou progresser.

Contactez-nous