[gegl] color-reduction: scale noise better according to luminance
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] color-reduction: scale noise better according to luminance
- Date: Sat, 10 Nov 2012 13:56:31 +0000 (UTC)
commit bc168bb62cf6b0b70251c90d3a81c9c08612ab11
Author: Ãyvind KolÃs <pippin gimp org>
Date: Sat Nov 10 12:16:24 2012 +0100
color-reduction: scale noise better according to luminance
operations/common/color-reduction.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/operations/common/color-reduction.c b/operations/common/color-reduction.c
index 5cd7b69..b4b1b1d 100644
--- a/operations/common/color-reduction.c
+++ b/operations/common/color-reduction.c
@@ -396,7 +396,9 @@ process_resilient (GeglBuffer *input,
gdouble value_clamped;
gdouble quantized;
- value = pixel [ch] + (1.4-(pixel[ch]/65535.0)) *(g_random_int_range (-65536, 65536) / (1 << channel_bits [ch]));
+ value = pixel [ch] +
+ (1.0/(((pixel[ch]+6*65535)/65535.0))/8 + 1.1) *(g_random_int_range (-65536, 65536) / (1 << channel_bits [ch]));
+
value_clamped = CLAMP (value, 0.0, 65535.0);
quantized = quantize_value ((guint) (value_clamped + 0.5), channel_bits [ch], channel_mask [ch]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]