How can I return the indexes of RBG?
Say p
is my Numeric Python array.
>>>x = 58
>>>y = 72
>>>p[y][x]
array([255, 255, 255], dtype=uint8)
I don't know what a Numeric Python array is or how to handle them but I found how to convert it to ['255', '255', '255']
, which I think I am pretty sure is a list, by using map(str, p[y][x])
and I can deal with those simple enough.
When I try p.index(p[y][x]) it throws AttributeError: 'numpy.ndarray' object has no attribute 'index'
.
And for p[y][x] in p:
throws ValueError: output operand requires a reduction, but reduction is not enabled
I want to return the y
and x
of all the same RBG and also count how many occurances there are of them.
gtk.gdk.Pixbuf.get_pixels_array This is where I got the Numeric Python array from.