diff --git a/Tests/images/bc6h.png b/Tests/images/bc6h.png index 422d47ff2..609f11489 100644 Binary files a/Tests/images/bc6h.png and b/Tests/images/bc6h.png differ diff --git a/Tests/images/bc6h_sf.png b/Tests/images/bc6h_sf.png index 14fb4cae1..6a3b73d5f 100644 Binary files a/Tests/images/bc6h_sf.png and b/Tests/images/bc6h_sf.png differ diff --git a/src/libImaging/BcnDecode.c b/src/libImaging/BcnDecode.c index 0058205f1..a57b74b61 100644 --- a/src/libImaging/BcnDecode.c +++ b/src/libImaging/BcnDecode.c @@ -688,11 +688,6 @@ bc6_clamp(float value) { } } -static float -bc6_gamma_correct(float value, float gamma) { - return powf(1.0f - expf(-value), 1.0f / gamma); -} - static void bc6_lerp(rgba *col, int *e0, int *e1, int s, int sign) { int r, g, b; @@ -700,9 +695,9 @@ bc6_lerp(rgba *col, int *e0, int *e1, int s, int sign) { r = (e0[0] * t + e1[0] * s) >> 6; g = (e0[1] * t + e1[1] * s) >> 6; b = (e0[2] * t + e1[2] * s) >> 6; - col->r = bc6_clamp(bc6_gamma_correct(bc6_finalize(r, sign), 2.2f)); - col->g = bc6_clamp(bc6_gamma_correct(bc6_finalize(g, sign), 2.2f)); - col->b = bc6_clamp(bc6_gamma_correct(bc6_finalize(b, sign), 2.2f)); + col->r = bc6_clamp(bc6_finalize(r, sign)); + col->g = bc6_clamp(bc6_finalize(g, sign)); + col->b = bc6_clamp(bc6_finalize(b, sign)); } static void