SBH Posted September 14, 2022 Share Posted September 14, 2022 Hi, does anyone here know whether it is possible to create a "contrast slider" with procedural texture? It's not very difficult to re-create the brightness slider, but for contrast I haven't managed to find the right formula. Thanks for any ideas in that direction... Quote Link to comment Share on other sites More sharing options...
Lisbon Posted September 14, 2022 Share Posted September 14, 2022 I am almost certain that it is possible. The problem is to deduce/find the formula. I don't know if you noticed, but the brightness/contrast adjustment has a "linear" option. I suspect that most google results will return the linear contrast formula which is less interesting from a practical point of view. Linear Vs Non Linear Unfortunately, I don't have the non-linear at hand but the linear contrast looks easy to implement. LinearContrast.afphoto SBH 1 Quote Link to comment Share on other sites More sharing options...
SBH Posted September 15, 2022 Author Share Posted September 15, 2022 Thanks! I've been poking around a bit more and found a non-linear way. I even managed to implement the separate control for highlights and shadow (a.k.a. move the "contrast center"). It's based on the "brightness" formula. (see first screenshot) The first half is the brightness and the second half is pulling down the shadows. It basically adds or subtracts to/from the pixel value whereas it considers its current value which makes it "non-linear". That's this part: ... *(1-R) ... Variable a controls the brightness and b controls the shadows. As it was a bit strong on most of my test images, the overall effect can be reduced with variable c. It basically divides the effect applied ... /(1+c) ... I'd like to have a slider to move the curve more left or right, but for now I'll try this solution on some more photos. Bildschirmaufnahme 2022-09-15 um 11.17.04.mov LinearContrast.afphoto Lisbon 1 Quote Link to comment Share on other sites More sharing options...
Lisbon Posted September 15, 2022 Share Posted September 15, 2022 4 hours ago, SBH said: I even managed to implement the separate control for highlights and shadow (a.k.a. move the "contrast center"). This is a great idea. It will minimize the risk of clipping by increasing the contrast. 4 hours ago, SBH said: It basically adds or subtracts to/from the pixel value whereas it considers its current value which makes it "non-linear". Definitely non-linear. I confirmed with the Scope. ---###--- Previously I said that linear contrast is less interesting from a practical point of view. But there is actually a situation where I use linear contrast. Very simple formula. Only for grayscale images: smoothsteplin(1-a, a, R) Much faster than Curves. Smoothsteplin.afphoto Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.