Announcement

Collapse
No announcement yet.

Soft Clip Formula

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Soft Clip Formula

    Anyone know the math behind the standard "Soft Clip" formula? I have the Reinhard Burn math, but I was looking for the traditional Soft Clip control, like what is in Chaos Player, or pretty much every app.

    Thanks.

  • #2
    Bump. Would also like to know
    James Burrell www.objektiv-j.com
    Visit my Patreon patreon.com/JamesBurrell

    Comment


    • #3
      The person who wrote the "Soft Clip" algorithm is no longer working for Chaos, but the pseudo code below explains my understanding of how it works.

      Code:
      x # input color channel
      soft_clip # soft clip input value from the ChaosPlayer's ui (used to control the clipping curve)
      r # result color
      
      sft = 2 ^ ( - soft_clip / 100 / 3.5 ) # threshold above which the clipping begins
      
      if x <= sft
         r = x
      else
         # Factor for smoother clipping.
         # As 'soft_clip' increases, 'f' increases, making the transition softer.
         f = 1 + soft_clip / 100
      
         # 'x' is translated and logarithmically compressed to make the clipping curve smoother.
         # The division by 'f' Ensures the curve's output is consistent with the softness factor.
         r = ln((x - sft) * f + 1) / f

      Comment

      Working...
      X