@Test
public void testColorWheelTranslucent() throws Exception {

    final int SIZE = 100;
    BufferedImage bi = new BufferedImage(SIZE, SIZE, BufferedImage.TYPE_4BYTE_ABGR);
    Graphics2D gr = bi.createGraphics();
    gr.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON));
    for (int s = 0; s < SIZE; s++) {
        int arcw = SIZE * s / SIZE;
        int arch = SIZE * s / SIZE;
        for (int h = 0; h < 360; h++) {
            float hue = h / 360f;
            float sat = s / (float) SIZE;
            Color c = Color.getHSBColor(hue, sat, 1F);
            c = new Color(c.getRed(), c.getGreen(), c.getBlue(), s * 255 / SIZE);
            gr.setColor(c);
            gr.fillArc(SIZE / 2 - arcw / 2, SIZE / 2 - arch / 2, arcw, arch, h, 1);
        }
    }
    gr.dispose();
    // simple palette checks
    ColorIndexer indexer = new Quantizer(256).buildColorIndexer(bi);
    IndexColorModel icm = indexer.toIndexColorModel();
    assertEquals(Transparency.TRANSLUCENT, icm.getTransparency());
    assertEquals(4, icm.getNumComponents());
    // quantize and check
    RenderedImage indexed = ColorIndexerDescriptor.create(bi, indexer, null);
    IndexColorModel icm2 = (IndexColorModel) indexed.getColorModel();
    assertEquals(icm, icm2);
    // the source image has up to 36000 colors + alpha (the distance has been checked visually)
    assertImagesSimilar(bi, indexed, 250);
}