Skip to content

Commit bb2886b

Browse files
committed
Fixed contrast calculation
1 parent ffbac6f commit bb2886b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/WPF.ImageEffects/Shaders/ImageShader.fx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ float4 main(float2 uv : TEXCOORD) : COLOR
77
float4 texColor = tex2D(Input, uv);
88
float4 final = texColor;
99
final = texColor + brightness;
10-
final = final * (contrast + 1.0);
10+
//final = final * pow((contrast + 1.0) / 1.0, 2);
11+
final = ((final - 0.5) * pow((contrast + 1.0) / 1.0, 2)) + 0.5;
1112

1213
final.a = texColor.a; //restore alpha value
1314

36 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)