I need to convert BufferedImage to java.awt.Point array. Am receiving Image as base64 string, then converting it to Byte and this array in converted to BufferedImage.
To do this I need to convert this to a java.awt.Point array. Am following the below steps. However the BufferedImage.getWriteableIndices seems to return 1 tile all the time.
String image = "image in base64 string"; // **** I can provide value for this if it helps, its a base64 string
byte buf = new sun.misc.BASE64Decoder().decodeBuffer(image);
InputStream in = new ByteArrayInputStream(buf,0,buf.length);
java.awt.Image buffImage = ImageIO.read(in);
int width = buffImage.getWidth(null);
int height = buffImage.getHeight(null);
int type = BufferedImage.TYPE_BYTE_GRAY; // you can experiment with this one
BufferedImage bi = new BufferedImage(width, height, type);
Graphics2D g2d = bi.createGraphics();
g2d.drawImage(buffImage, 0, 0, null);
java.awt.Point  myPoints = bi.getWritableTileIndices() ;
System.out.println("My Points size is "+myPoints.length); // This is always returning 1
Any kinda suggestion / direction would greatly help.
What does it mean to store an image as a point array? A java.awt.Point is two integers representing an (x,y) coordinate. A pixel is a single integer representing an rgb value. They appear to be two different concepts, or am I missing something?