public static int [ ] quantizeImage ( int pixels [ ] [ ] , int max_colors ) { Cube cube = new Cube ( pixels , max_colors ) ; cube . classification ( ) ; cube . reduction ( ) ; cube . assignment ( ) ; return cube . colormap ; }
Reduce the image to the given number of colors .