from PIL import *
image = ImageGrab.grab()
from the variable image i would like to obtain a list of lists in witch every pixel is rappresented like [R,G,B] every line of the image by the first index of the list and every colum of the image is rappresented by the second index of the list.
for example if we take an image that is only 4*4 pixel, i will like to convert it into a list like this:
[[[R,G,B],[R,G,B],[R,G,B],[R,G,B]],
[[R,G,B],[R,G,B],[R,G,B],[R,G,B]],
[[R,G,B],[R,G,B],[R,G,B],[R,G,B]],
[[R,G,B],[R,G,B],[R,G,B],[R,G,B]]]
list(image.getdata()). I am providing this answer because even though this question is closed, the specific StackOverflow question still comes up as the top answer on popular search engines for this query.