docs: public static MagickImage toMagick(BufferedImage pImage) throws MagickException {
          if (pImage == null) {
              throw new IllegalArgumentException("image == null");
          }
  
          long start = 0L;
          if (DEBUG) {
              start = System.currentTimeMillis();
          }
  
          try {
              ColorModel cm = pImage.getColorModel();
              if (cm instanceof IndexColorModel) {
                  // Handles both BilevelType, PaletteType and PaletteMatteType
                  return indexedToMagick(pImage, (IndexColorModel) cm, cm.hasAlpha());
              }
  
              switch (cm.getColorSpace().getType()) {
                  case ColorSpace.TYPE_GRAY:
                      // Handles GrayType and GrayMatteType
                      return grayToMagick(pImage, cm.hasAlpha());
                  case ColorSpace.TYPE_RGB:
                      // Handles TrueColorType and TrueColorMatteType
                      return rgbToMagic(pImage, cm.hasAlpha());
                  case ColorSpace.TYPE_CMY:
                  case ColorSpace.TYPE_CMYK:
                  case ColorSpace.TYPE_HLS:
                  case ColorSpace.TYPE_HSV:
                      // Other types not supported yet
                  default:
                      throw new IllegalArgumentException("Unknown buffered image type: " + pImage);
              }
          }
          finally {
              if (DEBUG) {
                  long time = System.currentTimeMillis() - start;
                  System.out.println("Conversion to MagickImage: " + time + " ms");
              }
          }
      }