Biological computations underlying grouping-by-similarity in lightness perception