I am very new to image processing. I have a PNG image (read using ImageIO.read()
) that yields BufferedImage.TYPE_CUSTOM
when I call getType()
on it.
BufferedImage bi = ImageIO.read(new URL("file:/C:/samp1.png"));
int type =bi.getType(); //TYPE_CUSTOM for samp1.png
Now I would like to convert it to one of the following models:
- TYPE_USHORT_GRAY
- TYPE_3BYTE_BGR
- TYPE_BYTE_GRAY
- TYPE_INT_RGB
- TYPE_INT_ARGB
The above needs to be done to process the image further using a library that recognises only the above types.
How do I convert from TYPE_CUSTOM
color model to other models?
Any help/pointers would be much appreciated. If there aren't any existing library to do this, any link/post to steps/algorithm would be great.