Dec 04

By default it does not support it. To get support for jpeg-lossless you need to install Java Advanced Imaging Image I/O Tools (jai-imageio).

You can download it from

written by objects \\ tags: , ,

Sep 29

The ImageIO class can be used to write an image as a JPEG encoded stream.If you write that stream to a ByteArrayOutputStream then you will end up with a byte array that contains the JPEG encoded image.

ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageIO.write(image, "JPEG", out);
byte[] imageBytes = out.toByteArray(); 

written by objects \\ tags: , ,