Python Function that converts a image into indexed image (similar to matlab function)