Re: [gtk-list] Problems reading RGB values from GdkImage



Fri Dec 10 1999, AVILA BERMEJO, FRANCISCO JOSE ->
> In this example program I read a GIF image with 3 colors
> (in RGB values):
> 
>    * (0,0,0)
>    * (255,255,255)
>    * (198,198,198)
> 
> I read this image the GdkMagic rutine ReadImage() and I convert it
> to a GdkImage with gdk_magick_to_gdkimage(). When I get the pixels of
> the GdkImage with the function gdk_image_get_pixel(), the initial
> RGB values are converted to:
> 
>     * (0,0,0)
>     * (65535,65535,65535)
>     * (50744,50744,50744)
> 
> How can I get the original RGB values in the range of 0-255?. I need
> them to apply some filter to the images, like edge detection,
> sharpening, gaussian blur and others.

Divide them by 256? Shift right by 8?
But are they really returned like this? gdk_image_get_pixel returns a
guint32, which only has room for 4x8 bits.

	n.

-- 
[ http://www.dtek.chalmers.se/~d95mback/ ] [ PGP: 0x453504F1 ] [ UIN: 4439498 ]
    Opinions expressed above are mine, and not those of my future employees.
		  Skingra er! Det finns ingenting att förstå!

PGP signature



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