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

Re: [pygame] Issue with pygame.mask



Peter Finlayson wrote:
I expected the default threshold (0,0,0) of this function to have it match only that the exact color specified (ie within 0 values of the color). However, it seems that it instead matches NO pixels.

The third comment about that function here seems to explain
what's happening:

   http://www.pygame.org/docs/ref/mask.html

"This creates a mask from the surface which has all the pixels set which have
color values above or equal to those in color, but below (and not equal to) the
values in threshold. So no pixel with a 255 value can possibly be considered.
And the default threshold doesn't let the mask have any set pixels for any given
surface."

However this seems to contradict what is said in the second
comment, so it may be a case of the blind leading the blind.

--
Greg