You know the height and the width of the image, no? So you know that every 'width' number of pixels will start a new row. So if you wanted say the fifth row down, second pixel, how would you find it?
The 1st line: 'width' number of pixels The 2nd line: 'width' number of pixels The 3rd line: 'width number of pixels The 4th line: 'width' number of pixels The 5th line: 2 pixels in from the left Add those up ~ width+width+width+width+2 Or 4*width+2 That number is the index to use to get the pixel at coords (2,5) so pixel = getdata() pixel[4*width+2] For this example. Work out a more general solution for yourself please. JS > getdata() returns a flattened list, [n] > > > but i am not sure how to access it. > > when I want to get rgb from a window of 100,200, > > get data starts from 0 (0~99, 0~199) > > the point of x,y = 2, 1 > > do I put in > > pixel[100] ? > > > it's actually not the case @_@ > > what should I put in ? _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor