Convert a gray scale intensity image to an Octave indexed image. The indexed image will consist of n different intensity values. If not given n will default to 64.