I have made some improvements to rgb2ind.m rgb2ind.m returns a
colormap that is too large for gnuplot to handle when you give rgb2ind
a rgb matrix resulting from a jpeg or png picture. My change makes
rgb2ind run longer but it results in a better picture and gnuplot does
not freeze up. The files are attached.