docs: private static BufferedImage paletteToBuffered(MagickImage pImage, boolean pAlpha) throws MagickException {
          // Create indexcolormodel for the image
          IndexColorModel cm;
  
          try {
              cm = createIndexColorModel(pImage.getColormap(), pAlpha);
          }
          catch (MagickException e) {
              // NOTE: Some MagickImages incorrecly (?) reports to be paletteType,
              //       but does not have a colormap, this is a workaround.
              return rgbToBuffered(pImage, pAlpha);
          }
  
          // As there is no way to get the indexes of an indexed image, convert to
          // RGB, and the create an indexed image from it
          BufferedImage temp = rgbToBuffered(pImage, pAlpha);
  
          BufferedImage image;
          if (cm.getMapSize() <= 16) {
              image = new BufferedImage(temp.getWidth(), temp.getHeight(), BufferedImage.TYPE_BYTE_BINARY, cm);
          }
          else {
              image = new BufferedImage(temp.getWidth(), temp.getHeight(), BufferedImage.TYPE_BYTE_INDEXED, cm);
          }
  
          // Create transparent background for images containing alpha
          if (pAlpha) {
              Graphics2D g = image.createGraphics();
              try {
                  g.setComposite(AlphaComposite.Clear);
                  g.fillRect(0, 0, temp.getWidth(), temp.getHeight());
              }
              finally {
                  g.dispose();
              }
          }
  
          // NOTE: This is (surprisingly) much faster than using g2d.drawImage()..
          // (Tests shows 20-30ms, vs. 600-700ms on the same image)
          BufferedImageOp op = new CopyDither(cm);
          op.filter(temp, image);
  
          return image;
      }