I have an image img:
img
>>> img.shape (200, 200, 3)
On pixel (100, 100) I have a nice color:
>>>
You could do this:
set( tuple(v) for m2d in img for v in m2d )