Hi,

I'm using pyglet1.2alpha1 with Python2.7 for a project. Previously I was 
using Python3.2, but downgraded to make use of some 3rd party packages that 
have not yet been made compatible with 3.x.

In my project I load an image using:

maskImage = pyglet.resource.image('test.bmp')

At some point I want to check the intensity of a particular pixel in the 
image, so I perform:

image_data = maskImage.get_region(x, y, 1, 1).get_image_data()
data = image_data.getData('I', 1)

I am just checking whether this pixel is black or white, so I check whether 
data is greater than zero. This worked fine in Python 3.2, but now the 
contents are always greater than zero, regardless of pixel colour. 

I cast the data to a string and printed it to my console, and it is either 
blank or ASCII characters.

Is this an issue with python 2.7's handling of bytes? Is there some way I 
can get pyglet to read the data into a more amenable format?

Thanks,

Sam



-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to