docs: public static BufferedImage getIndexedImage(BufferedImage pImage, int pNumberOfColors, Color pMatte, int pHints) {
          // NOTE: We need to apply matte before creating color model, otherwise we
          // won't have colors for potential faded transitions
          IndexColorModel icm;
  
          if (pMatte != null) {
              icm = getIndexColorModel(createSolid(pImage, pMatte), pNumberOfColors, pHints);
          }
          else {
              icm = getIndexColorModel(pImage, pNumberOfColors, pHints);
          }
  
          // If we found less colors, then no need to dither
          if ((pHints & DITHER_MASK) != DITHER_NONE && (icm.getMapSize() < pNumberOfColors)) {
              pHints = (pHints & ~DITHER_MASK) | DITHER_NONE;
          }
          return getIndexedImage(pImage, icm, pMatte, pHints);
      }