I am trying a simple nested for loop in python to scan a threshold-ed image to detect the white pixels and store their location. The problem is that although the array it is reading from is only 160\*120 (19200) it still takes about 6s to execute, my code is as follows and any help or guidance would be greatly appreciated:

```
im = Image.open('PYGAMEPIC')

r, g, b = np.array(im).T
x = np.zeros_like(b)

height = len(x[0])
width = len(x)

x[r > 120] = 255                                        
x[g > 100] = 0                                      
x[b > 100] = 0              

row_array = np.zeros(shape = (19200,1))
col_array = np.zeros(shape = (19200,1))

z = 0
for i in range (0,width-1):
    for j in range (0,height-1):
        if x[i][j] == 255:
            z = z+1
            row_array[z] = i

            col_array[z] = j

```