static int[] pixelsOfBufferedImage(BufferedImage image) ctex { int width = image.getWidth(); int height = image.getHeight(); int[] pixels = new int[width*height]; PixelGrabber pixelGrabber = new PixelGrabber(image, 0, 0, width, height, pixels, 0, width); if (!pixelGrabber.grabPixels()) fail("Could not grab pixels"); ret pixels; }