How could a 32bpp image ( ARGB ) could be converted to a 16bpp image ( ARGB ) using Java\'s libraries? For my curiosity, at pixel level, what does this conversion do? If I have
Read in the image and save it in the format you need. From http://www.exampledepot.com/egs/javax.imageio/Graphic2File.html
// Create an image to save
RenderedImage rendImage = myCreateImage();
// Write generated image to a file
try {
// Save as PNG
File file = new File("newimage.png");
ImageIO.write(rendImage, "png", file);
// Save as JPEG
file = new File("newimage.jpg");
ImageIO.write(rendImage, "jpg", file);
} catch (IOException e) {
}
See the output from javax.imageio.ImageIO.getWriterFormatNames() to locate the format you need.
The internal representation of each pixel does not change (except for loss of representation) when using 16 bpp, but the bytes stored on disk will.