Licson Lee says to Ow< [MSFW]
n: 8-bit sample t: target bits per sample f = n / 255 new_sample = floor(f * (2^t - 1)) / (2^t - 1) * 255