int[] (@NotNull Image image) { DataBuffer buffer = image instanceof BufferedImage ? ((BufferedImage)image).getRaster().getDataBuffer() : null; if (buffer instanceof DataBufferInt) { return ((DataBufferInt)buffer).getData(); } else { @SuppressWarnings("UndesirableClassUsage") BufferedImage convertedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB); convertedImage.getGraphics().drawImage(image, 0, 0, null); return getArgbData(convertedImage); } }