gimp r27062 - in trunk: . app/base



Author: mitch
Date: Thu Sep 25 18:14:05 2008
New Revision: 27062
URL: http://svn.gnome.org/viewvc/gimp?rev=27062&view=rev

Log:
2008-09-25  Michael Natterer  <mitch gimp org>

	* app/base/colorize.c (colorize_calculate): fix calculation of
	final lookup table to not darken the image.



Modified:
   trunk/ChangeLog
   trunk/app/base/colorize.c

Modified: trunk/app/base/colorize.c
==============================================================================
--- trunk/app/base/colorize.c	(original)
+++ trunk/app/base/colorize.c	Thu Sep 25 18:14:05 2008
@@ -67,9 +67,13 @@
 
       gimp_hsl_to_rgb (&hsl, &rgb);
 
-      colorize->final_red_lookup[i]   = i * rgb.r;
-      colorize->final_green_lookup[i] = i * rgb.g;
-      colorize->final_blue_lookup[i]  = i * rgb.b;
+      /*  this used to read i * rgb.r,g,b in GIMP 2.4, but this produced
+       *  darkened results, multiplying with 255 is correct and preserves
+       *  the lightness unless modified with the slider.
+       */
+      colorize->final_red_lookup[i]   = 255.0 * rgb.r;
+      colorize->final_green_lookup[i] = 255.0 * rgb.g;
+      colorize->final_blue_lookup[i]  = 255.0 * rgb.b;
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]