Skip to content

Instantly share code, notes, and snippets.

## Creates a gamma-corrected lookup table
import math
def gamma(nsteps, gamma):
gammaedUp = [math.pow(x, gamma) for x in range(nsteps)]
return [x/max(gammaedUp) for x in gammaedUp]
def rounder(topValue, gammas):
return [min(topValue, round(x*topValue)) for x in gammas]