def get_most_interesting_row(pil_image):
    final = (None, set(), None, None)  # row, row_set, first_pixel, y_pos
    for y_pos, row in enumerate(iter_rows(pil_image)):
        row_set = set(row)
        if len(row_set) > len(final[1]):
            final = row, row_set, row[0], y_pos
        if len(row_set) == pil_image.width:
            break  # Can't get bigger.
    return final
Look for a row in the image that has the most unique pixels.
dataset/ETHPy150Open Robpol86/colorclass/tests/screenshot.py/get_most_interesting_row