<p>The effect in the photo is very close to a simple scale-bias per pixel. After a bit of tweaking, I found that applying the transformation: $x' = 0.77x + 38$ to the raw pixel values (as bytes) gives something quite close to your output:</p>

<p><a href="https://i.sstatic.net/ti9Pv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ti9Pvm.png" alt="transformed image"></a></p>

<p>In this case the effect of the scale-bias is to reduce the contrast (scale factor &lt; 1) while keeping the overall brightness about the same.</p>

<p>Example Python code (with numpy and pillow) to do this transformation:</p>

<pre><code>import numpy as np
from PIL import Image
a = np.array(Image.open("input.png"), dtype=np.float32)
b = a * 0.77 + 38
Image.fromarray(np.uint8(np.rint(b))).save("output.png")
</code></pre>

<p>For learning how to implement many basic image processing operations, I've found these <a href="http://homepages.inf.ed.ac.uk/rbf/HIPR2/wksheets.htm" rel="nofollow noreferrer">Image Processing Operator Worksheets</a> from the University of Edinburgh helpful.</p>

CC BY-SA 3.0
2015-12-28T00:38:29.163Z
2015-12-28T00:38:29.163Z
Nathan Reed
<p>What is the pixel-level explanation of the fade effect, that was first popularized by Instagram? I want to implement this effect programmatically—that is, I want to understand what this effect is doing to each pixel.</p>

<p><a href="https://i.sstatic.net/IVdTT.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IVdTT.jpg" alt="enter image description here"></a></p>

<p>Also, if anyone could point me to resources from which I can learn more about how image filters are implemented, that would be great.</p>

CC BY-SA 3.0
2015-12-25T22:39:48.917Z
Very easy way to achieve a similar look is to just add a small value to the color or each pixel, then clamp to max (255 or 1). It will make the image look more "washed out".
glampert
<image-processing>
Instagram's fade effect
cauliflower
# Instagram's fade effect

(Asked by: username_0 on 2015-12-25)

What is the pixel-level explanation of the fade effect, that was first popularized by Instagram? I want to implement this effect programmatically—that is, I want to understand what this effect is doing to each pixel.

[![enter image description here](https://i.sstatic.net/IVdTT.jpg)](https://i.sstatic.net/IVdTT.jpg)

Also, if anyone could point me to resources from which I can learn more about how image filters are implemented, that would be great.

**Tags:** image-processing

> **Comments:**
> **username_1**: Very easy way to achieve a similar look is to just add a small value to the color or each pixel, then clamp to max (255 or 1). It will make the image look more "washed out".  

---

## 1 answers

### Answer by username_2 on 2015-12-28. Score: 5 | Accepted answer

The effect in the photo is very close to a simple scale-bias per pixel. After a bit of tweaking, I found that applying the transformation: $x' = 0.77x + 38$ to the raw pixel values (as bytes) gives something quite close to your output:

[![transformed image](https://i.sstatic.net/ti9Pvm.png)](https://i.sstatic.net/ti9Pv.png)

In this case the effect of the scale-bias is to reduce the contrast (scale factor < 1) while keeping the overall brightness about the same.

Example Python code (with numpy and pillow) to do this transformation:

```
import numpy as np
from PIL import Image
a = np.array(Image.open("input.png"), dtype=np.float32)
b = a * 0.77 + 38
Image.fromarray(np.uint8(np.rint(b))).save("output.png")

```

For learning how to implement many basic image processing operations, I've found these [Image Processing Operator Worksheets](http://homepages.inf.ed.ac.uk/rbf/HIPR2/wksheets.htm) from the University of Edinburgh helpful.


---

