I'm no expert on it, but a quick scan of the pyglet programming guide
reveals:
"""
To retrieve pixel data in a particular format, use the get_data
method, specifying the desired format and pitch. The following example
reads tightly packed rows in RGB format (the alpha component, if any,
will be discarded):
kitten = kitten.get_image_data()
data = kitten.get_data('RGB', kitten.width * 3)
data always returns a string, however it can be set to a ctypes array,
stdlib array, list of byte data, string, or ctypes pointer. To set the
image data use set_data, again specifying the format and pitch:
kitten.set_data('RGB', kitten.width * 3, data)
"""
(http://pyglet.org/doc/programming_guide/
accessing_or_providing_pixel_data.html)
On Sep 3, 2:43 am, mclovin <[EMAIL PROTECTED]> wrote:
> Is it possible to get the pixel color from an image at (x,y)?
> I need the pixel color in RGBA format.
>
> so like if i had an image is there a function that would do this:
>
> >print img.get_pixel(20,20)
>
> [200,23,100,256]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---