Generalize CLAHE algorithm for 8-bit and 16-bit (possibly others).