Instagram Lux effect

前端 未结 2 1446
-上瘾入骨i
-上瘾入骨i 2021-01-31 00:45

Instagram added a Lux button recently, which allows auto-contrasting / leveling for the pictures you take.

I have a bunch of pictures that I need to autolevel in a simi

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 01:24

    For those who haven't solved a linear equation in a very long time (such as I) here the required parameters from Adi Shavit's answer in a formula (in pseudo code) - I renamed p5 and p95 to p1 and p2 (as 5 is just a suggestion):

    p_div := float(p1) / p2;
    b := -255 * p_div / (1 - p_div);
    a := (255 - b) / p2;
    

    I don't know if it can be done easier, but you can check that:

    a * p1 + b  -> 0
    a * p2 + b -> 255
    

提交回复
热议问题