GdkPixbuf change brightness [was:(no subject)]



On Mon, 2005-01-10 at 12:28, anne isac wrote:
Hi
I'm new to Gtk.
I'm trying to change the brightness of an image. I get the pixbuf of the image using
testPixbuf=gtk_image_get_pixbuf(testImage);
then I use
testPixbuftemp=gdk_pixbuf_add_alpha(testPixbuf,TRUE,r,g,b); to change the brightness.
[snip]
I'm not able to change the Brightness of the image.if r,g,b= 255 then all the white pixels in the image 
turns transparent other than that on any other value of r,g,b i get no change in the image.

It happens because you're adding an alpha channel to the pixmap with the
call to gdk_pixbuf_add_alpha, not changing it's brightness.

You can change the brightness in a GdkPixbuf in various ways.

One convenient could be a call to gdk_pixbuf_saturate_and_pixelate().

http://developer.gnome.org/doc/API/2.0/gdk-pixbuf/gdk-pixbuf-util.html#gdk-pixbuf-saturate-and-pixelate


Regards.
-- 
Iago Rubio



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