What is the algorithm used to normalize 16-bit valued sentinel-2A bands to 8-bit valued bands?

The visual asset in the Planetary Computer links to the TCI_10m file output by sen2cor, converted to COG (note that the COG conversion causes the issue described at What is the valid range for the TCI product?). But the actual values come straight out of sen2cor, so we’re using whatever algorithm it uses.

@Loki you can reach out on the Planetary Computer’s discussion page if you have Planetary Computer-specific questions.