converts RGB-matrix to index-matrix
[image,colormap]=ergb2idx(matrix)
matrix :
RBG-matrix
image :
index-matrix
colormap :
color table