def to_vectors(rgb_image, row_or_col):
    """rgb image -> list of lists of RGB tuples"""
    assert(rgb_image.mode == "RGB"), "must be a RGB image"""
    assert(row_or_col in (0, 1)), "row = 0, col = 1"
    vectors = []
    x_size, y_size = rgb_image.size

    if(row_or_col == 0):
        for y_coord in range(0, y_size):
            row = []
            for x_coord in range(0, x_size):
                row.append(rgb_image.getpixel((x_coord, y_coord)))
            vectors.append(row)
    else:
        for x_coord in range(0, x_size):
            col = []
            for y_coord in range(0, y_size):
                col.append(rgb_image.getpixel((x_coord, y_coord)))
            vectors.append(col)
    return(vectors)