Cuatro amigas posando juntas y tomando una selfie al aire libre.

The maths behind Instagram's filters

  • 4 June 2025
  • 4 minutos
  • Blog

With more than 2 billion active users globally, Instagram has become one of the world's leading platforms for digital communication and content generation.

Since its origins, the creative filters it offers to personalise images have been a distinctive element of the platform, contributing decisively to its visual identity and differentiating it from other social networks. Iconic filters such as Clarendon, Juno, Lark, Gingham or Ludwig have become part of the conversation.

But from a technological point of view, Instagram filters are much more than pure aesthetics: every time the Valencia filter is applied to an image, mathematical function transformations are being executed that alter pixel values following pre-designed curves.

Pixels and functions: the mathematical trick behind filters

To understand the science of an Instagram filter, one must first get to know its key players:pixels. A digital photo is made up of millions of tiny coloured dots called pixels, and each pixel is described by numbers. For example, in an RGB (red, green, blue) image, each pixel is actually a triplet of numbers indicating how much red, green and blue intensity it contains (in values ranging from 0 to 255). When you apply a filter, you are actually modifying these numbers using mathematical formulae. 

In the same way that a recipe tells you how to transform different ingredients into a great dinner, a filter tells you how to transform the colours of an image into another style. Some recipes are simple: for example, increasing the brightness of a photo means taking each pixel and increasing its colour values to make everything look lighter (bringing them a little closer to 255, which would be white). Other recipes are more complex, such as changing the tone of the image to make it look like a warmer sunset: in that case the filter mightintensify the red componentof each pixel (e.g. by adding or multiplying by a factor) to create that reddish atmosphere.

Many filters uset one curves or LUTs (Look-Up Tables) to apply more elaborate transformations. Instead of simply "brightening up" or "lowering contrast" linearly, a tone curve is a graph that reflects the value of each colour after a filter.  

For example, a filter may bet that originally dark pixels become much lighter, but those that were already bright hardly change at all, thus achieving more contrast. A LUT works like a table thattakes an input colour and converts it to an output colour. That is, the filter consults that table to "know" that, for example, a specific blue should become a greenish blue, or that a slightly pale skin tone should be transformed into a more tanned one. In this way, this colour mapping processassigns a new value to each pixel according to predefined rules, achieving effects such as dramatic contrasts, vintage colours or dreamy atmospheres consistently throughout the photo.

In short, altering pixels with mathematical functions means thatevery number in the image is modified according to a formula. This can be adding a fixed amount, multiplying by a percentage, applying a curved function (e.g. raising to a power to enhance halftones), or using reference tables filled with pre-calculated numbers.

The important thing is that behind every "brightness", "contrast" or "saturation" slider we use in the app, there are mathematical operations. Instagram's filters apply hundreds of these operations in milliseconds to each photo, adjusting each pixel to get the desired look.

But filters don't just change colours; many also add fun effects to a face: puppy dog ears and nose, flower crowns, virtual make-up, etc. For that effect to be placed in the right place, the software must firstrecognise a facein the image.

That is, it needs to detect where the face is and understand certain features of it. How does a mobile phone achieve something like this? The answer lies incomputer vision, an area of artificial intelligence that teaches machines to "see" images. How computer vision algorithms work, and the role they play in apps like Instagram, will be discussed in the next article.

Read more about

TikTok, Artificial Intelligence and mathematical probability

5 reasons why you should study mathematics applied to software engineering.

The perfect tandem for your future: mathematics and software engineering.

Related Insights

Una multitud de personas se reúne en un espacio amplio y luminoso, interactuando entre sí.
Videojuegos, Branding, Interiores, Creación gráfica, Producto, Ciencia y Tecnología, Moda, Animación & UX

What to study if you’re into design and technology: a guide to finding your field of study

31 August 2026

If you’re interested in both design and technology, you don’t need to choose between creativity and technique, but rather to identify the type of problem you want to tackle. Disciplines such as Fashion, Interior Design, Product Design and UX, Visual Communication, Animation, Video Games, and Data Science and AI apply varying degrees of both tools depending on whether they focus on the body, space, use, meaning, time or systems.

Un grupo de jóvenes interactúa frente a varias pantallas de computadora en un entorno colaborativo.
Ciencia y Tecnología

How to use AI to study without stopping yourself from thinking: five checks to carry out before accepting an answer

24 July 2026

Using artificial intelligence to study can help you understand, practise and revise, but first you must check whether it is permitted, make an initial effort yourself, decide what role it will play, verify its answers and retain ownership of the process. Citing the tool does not replace the need for permission, nor does it automatically make its content a reliable source.

Un hombre y una mujer están colaborando en una computadora portátil mientras revisan documentos en un entorno de estudio.
Ciencia y Tecnología

Master’s in Cybersecurity and Ethical Hacking at UDIT: how to move from finding vulnerabilities to building digital resilience

26 June 2026

UDIT’s Official Online Master’s Degree in Cybersecurity and Ethical Hacking is designed for professionals with a technical or scientific background who wish to specialise in offensive security, coordinated defence, Red Team, Purple Team, OSINT, forensic analysis, incident response and GRC. It’s not just about learning tools: it’s about developing the judgement needed to protect digital assets when the risk is already within the system.

Dos mujeres interaccionan con robots en un entorno tecnológico moderno.
Ciencia y Tecnología

What career opportunities does studying robotics offer? Real-world jobs beyond simply ‘building robots’

18 June 2026

Studying robotics can lead you to design, programme, integrate and validate intelligent systems: mobile robots, connected devices, AIoT solutions, automation, human-machine interfaces, or prototypes applied to healthcare, logistics, industry, mobility, education or care. The key is not simply ‘building robots’ in the abstract, but solving real-world problems by combining software, sensors, AI, electronics and interaction design.

Un joven concentrado trabajando en una computadora portátil en una mesa.
Ciencia y Tecnología

Official Master's Degree in Artificial Intelligence at UDIT: from using AI to building real solutions

22 May 2026

Knowing what prompt you give a model to produce a useful result is a skill. Knowing why that model is wrong under certain conditions, how to improve its performance with more representative training data, or what legal constraints are involved in deploying it in production - that requires another level of training.

If you are comparing artificial intelligence masters in Madrid and your question is no longer general but specific - what is the technical level of the programme, is your previous background sufficient, what is the actual workload of the master's programme like - this article is written for that.