From 5da250fc8fcf8946e7ecee5d08bdc50f50d4c6eb Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 7 Jan 2008 20:35:30 +0000 Subject: [PATCH] add some comments about how this code is different from base/colorize.c 2008-01-07 Michael Natterer * app/gegl/gimpoperationcolorize.c (process): add some comments about how this code is different from base/colorize.c svn path=/trunk/; revision=24564 --- ChangeLog | 5 +++++ app/gegl/gimpoperationcolorize.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c1b1a3ca4..aa0d185358 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-07 Michael Natterer + + * app/gegl/gimpoperationcolorize.c (process): add some comments + about how this code is different from base/colorize.c + 2008-01-07 Michael Natterer * app/core/core-types.h: include gegl/gegl-types.h instead of diff --git a/app/gegl/gimpoperationcolorize.c b/app/gegl/gimpoperationcolorize.c index 684922d776..30948ac3ef 100644 --- a/app/gegl/gimpoperationcolorize.c +++ b/app/gegl/gimpoperationcolorize.c @@ -202,9 +202,14 @@ gimp_operation_colorize_process (GeglOperation *operation, gimp_hsl_to_rgb (&hsl, &rgb); - dest[RED_PIX] = rgb.r; - dest[GREEN_PIX] = rgb.g; - dest[BLUE_PIX] = rgb.b; + /* the code in base/colorize.c would multiply r,b,g with lum, + * but this is a bug since it should multiply with 255. We + * don't repeat this bug here (this is the reason why the gegl + * colorize is brighter than the legacy one). + */ + dest[RED_PIX] = rgb.r; /* * lum; */ + dest[GREEN_PIX] = rgb.g; /* * lum; */ + dest[BLUE_PIX] = rgb.b; /* * lum */; dest[ALPHA_PIX] = src[ALPHA_PIX]; src += 4;