Have you ever tried to increase the saturation in your photos, excited to see the increase in vibrant colors and beauty, only to look at your skin and realize you look like a Cheeto?
I've made a free tool to fix this that you're going to love! 😉 Download ↓
The problem rests in the fact that current saturation algorithms use a multiplication based approach, so if you double the saturation, (that is, every single pixel in the image doubles its saturation value), it would cause the very lowly saturated pixels to still be very low (e.g. 0.1 doubled is only 0.2), and very highly saturated pixels become immensely more saturated (e.g. 70 doubled is 140). Because of this, the not so colorful parts of your image stay not so colorful, while the already colorful parts of your image become unrealistically colorful.
So, we need a formula that adjusts the lowly colored pixels much more strongly than it adjusts the highly colored pixels. We built a smart algorithm for adjusting saturation that I preview below:
Now, there are many asymptote equations to accomplish the task of increasing lowly saturated pixels more strongly than the already highly saturated pixels, so what’s the most natural way to do so? We know from physics that lighting deltas with roots/exponents, so that’s a good place to start. Ironically, that’s as far as we need to go. Current Saturation Filters adjust a pixel’s saturation (s) with a formula f(s) which simply multiplies, that is, to double (x2) your saturation, the formula is simply f(s)=2s, for a formula that raises lower saturation values much more strongly than it raises higher saturation values, and follows natural laws of lighting, we can simply use f(s)=s^(1/p). [In this case p=2 since we are doubling saturation]. I’ve graphed the two equations below so you can see the difference, low-s values (x-axis, saturation values) shoot up much higher much faster, and high saturation values (further down the x-axis) barely increase.
Brightness suffers from similar issues, stemming back to the days of early computing when pixel adjustments had to be fast and we didn’t have the processing power we have today to easily calculate roots on the fly for millions of pixels at a time. We can actually apply the exact same equation but to a pixels brightness value instead of its saturation value and we see much more realistic brightness adjustments (increasing or decreasing). Below I’ve included examples of original images, their adjustments using the new smart algorithm, and their adjustments using industry standard algorithms.
You’re probably interested in all of this if you’ve read this far, but unless you’re a computer programmer you’re probably feeling a little confused about how you can actually do anything with this new-found knowledge. Lucky for you, I’ve coded an app that allows you to apply this smart-algorithm to your photos, 100% free, no watermarks or anything, just enjoy it and enjoy life and tell your friends! (And follow me on Instagram @albert).
To download the app, you can simply tap on the image below to find it on the Apple AppStore
(Android Users I am sorry, if I have time and if the community is really digging this tool, I will try and code an Android version for you or have one of my programmers do it when they are free!)
Thanks for learning with me,
Depending on the processor, a faster algorithm to f(s,p)=s^(1/p) could be f(s,p)=EXP((1/p)*ln(s)). I work in Objective-C so I don’t need this.
Additionally, processing these functions is slow for millions of pixels but there are only so many saturation (or brightness) values from 0.00-1.00 that you can actually just pre-calculate all of the results for any values p that you will allow your users to use, and use look-up tables to speed up this filter’s processing speed to even faster than current saturation adjustment algorithms.
Note: In my demo app, I perform all of these alogrihtms on CPU; you could use shaders and switch to GPU and speed would be near-instant, so optimizations likely won't be a real issue.
Both of these algorithms, and any of their refactored forms, for use in saturation and/or brightness adjustment of images are pending filing of patent via Apps4Life, LLC.
For licensing or rights-acquisition inquiries, please contact me: