public Palette makeQuantizedRgbaPalette(final BufferedImage src, final boolean transparent, final int max) throws ImagingException {
        return new MedianCutQuantizer(!transparent).process(src, max, new LongestAxisMedianCut());
    }
Builds an inexact possibly translucent palette of at most {@code max} colors in {@code src} using the traditional Median Cut algorithm. Color bounding
boxes are split along the longest axis, with each step splitting the box. All bits in each component are used. The Algorithm is slower and seems exact
than {@linkplain #makeQuantizedRgbPalette(BufferedImage, int)}.

@param src         the image whose palette to build
@param transparent whether to consider the alpha values
@param max         the maximum number of colors the palette can contain
@return the palette of at most {@code max} colors
@throws ImagingException if it fails to process the palette
src/main/java/org/apache/commons/imaging/palette/PaletteFactory.java