Grayscaling
Grayscale is a form of memory reduction. Consquently the you can only move from \(k = 8 \to k = 1 (L=256 \to L = 2)\). The alternative is information addition which is not possible.
\[ k = 8 \to k = 1 (L=256 \to L = 2) \]
for c in range(0, new_L):
new_img[(img >= c*L/new_L) & (img < (c+1)*L/new_L)] = c
\[ c \times \frac{L}{L_{new}, (c +1 ) \times \frac{L}L_{new}} \]