def getHitmask(image):
 mask = []
 for x in range(image.get_width()):
  mask.append([])
  for y in range(image.get_height()):
   mask[x].append(bool(image.get_at((x, y))[3]))
 return mask

def getHitmask ( image ) : mask = [ ] for x in range ( image . get_width ( ) ) : mask . append ( [ ] ) for y in range ( image . get_height ( ) ) : mask [ x ] . append ( bool ( image . get_at ( ( x , y ) ) [ 3 ] ) ) return mask
returns a hitmask using an images alpha .