Looking for a more gentle Brightness/Contrast algorithm than the native node I am trying to put together a brightness/contrast node group.
I am aware of the one in Blender, but the algorithm is lacking in my opinion.
Here's an example:



Here's an adjustment made in Photoshop:


I am looking for something that is close to the non-legacy algorithm used in Photoshop. Something more gentle, that doesn't blow out the color and saturation. I've done a google search and came across some algorithms but I don't know which yields the best result.
Edit: Here is some information I found after digging a little bit about how Photoshop does Brightness/Contrast:

Prior to CS3, Brightness/Contrast applies a linear transformation to the transfer curve: adjusting brightness alters the polynomial constant, sliding the curve to one side; while adjusting contrast alters the polynomial scalar, expanding or compressing the curve. In later versions, the core behavior was changed to a non-linear transformation, while this linear behavior is retained as Legacy mode.

So it sounds like I need a non-linear transformation that alters the &quot;polynomial scalar&quot;. I'm not sure exactly what that means in practice.
Edit2: More information found here (Emphasis mine):

The current library implementation (v20.6 on the moment of writing) uses default Photoshop algorithm that preserves the full tonal range from the shadows to highlights, but it doesn't yet support legacy behavior.

Edit3: I did some more digging:
An implementation in Python
Fundamentals of Image Processing (Go to page 43)
I'm hoping someone with background in image processing could lend a helping hand here.
Thanks so much for any help.
The default brightness contrast node is a broken piece of anachronistic mess.
“Brightness” is exposure typically.
“Contrast” is stretching values apart or pulling them together around some image maker chosen pivot point.
So exposure is a pure multiply. Change to the CDL node and use slope.
For contrast, you can use the power of the CDL.
For a pivoted contrast, it would be correct to use a value node, and divide your RGB by the value. The value is your pivot, so for example, start with 0.18 for middle grey. Then apply the power via the CDL. Then on the other side of the node, multiply the output RGB by the pivot value. Think of the pivot as the point that values will push away from (greater “contrast”) or pull toward (“less contrast”) depending on the value of the power.
Photoshop is a display referred assumption, and formulas don’t work under the same assumptions in a radiometric-like RGB domain.