List of utility methods to do BufferedImage to Shape
Shape | imageToShape(BufferedImage image) image To Shape Area area = new Area(); Rectangle rectangle = new Rectangle(); int y1, y2; for (int x = 0; x < image.getWidth(); x++) { y1 = Integer.MAX_VALUE; y2 = -1; for (int y = 0; y < image.getHeight(); y++) { int rgb = image.getRGB(x, y); ... |
Shape | imageToShape(BufferedImage image) image To Shape Area area = new Area(); int width = image.getWidth(); int height = image.getHeight(); int[] imgData; int type = image.getType(); if (type == BufferedImage.TYPE_INT_ARGB_PRE || type == BufferedImage.TYPE_INT_RGB) { imgData = ((DataBufferInt) image.getRaster().getDataBuffer()).getData(); } else { ... |
Shape | imageToShapeOld(BufferedImage image) image To Shape Old Area area = new Area(); Rectangle rectangle = new Rectangle(); int y1, y2; int width = image.getWidth(); int height = image.getHeight(); int[] imgData; int type = image.getType(); if (type == BufferedImage.TYPE_INT_ARGB_PRE || type == BufferedImage.TYPE_INT_RGB) { ... |