code: 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;
      }
docs: Reduce the image to the given number of colors.
  
  @param pixels an in/out parameter that should initially contain
  [A]RGB values but that will contain color palette indicies upon return.
  
  @return The new color palette.