def image_data(image):
    """Returns a list of RGBA values of pixels of the image.

    The pixels are listed row by row.
    """
    raw = image._img.get_image_data()
    pitch = raw.width * 4
    data = raw.get_data('RGBA', pitch)
    rows = []
    for y in range(raw.height):
        rows.append([])
        for x in range(raw.width):
            i = (y*raw.width + x) * 4
            r, g, b, a = int(data[i+0])/255, int(data[i+1])/255, int(data[i+2])/255, int(data[i+3])/255
            rows[y].append((r, g, b, a))
    return rows