Just to add a few more details to the previous answer, each set of 3 array elements do represent 8-bit levels of red, green and blue, and it goes rows first, then columns.
So, the first 3 elements are RGB for the pixel on the top left corner, elements 3, 4, and 5 are RGB for the second pixel of the first row, and so on.