メインコンテンツまでスキップ

blendLighten: Maximum Luminosity Selection

Mathematical Foundation of Lightening

Lighten blending implements maximum value selection between base and blend colors for each channel. This creates natural brightening effects by always choosing the lighter tone, ensuring the result is never darker than either input.

The mathematical definition is:

Cresult=max(Cbase,Cblend)C_{result} = \max(C_{base}, C_{blend})

This component-wise maximum operation ensures that only brighter values contribute to the final result, creating natural highlight preservation without complex mathematical transformations.

Selective Brightening Properties

PropertyDescriptionMathematical Expression
Component IndependenceEach RGB channel processed separatelyR=max(R1,R2)R = \max(R_1, R_2)
Monotonic BrighteningResult never darker than inputsCresultmax(C1,C2)C_{result} \geq \max(C_1, C_2)
Identity PreservationBlack blend leaves base unchangedmax(C,0)=C\max(C, 0) = C
Symmetric OperationOrder independencemax(A,B)=max(B,A)\max(A, B) = \max(B, A)
ライブエディター
const fragment = () => {
      const leftCircle = float(0.25).smoothstep(0.2, uv.sub(vec2(0.35, 0.5)).length())
      const rightCircle = float(0.25).smoothstep(0.2, uv.sub(vec2(0.65, 0.5)).length())
      const baseColor = vec3(0.8, 0.2, 0.4)
      const blendColor = vec3(0.3, 0.9, 0.2)
      const base = baseColor.mul(leftCircle)
      const blend = blendColor.mul(rightCircle)
      const result = blendLightenVec3(base, blend)
      return vec4(result, 1)
}