JPEG Quality
Hello all,
I open JPEG, make some transformations and want to save it again.
Is there any possibility to get the quality of the file I have opend and to save the JPEG with the same quality as it was created.
In other words I want to find out this quality param:
encParam.setQuality (1.0f, false);
Thanks in advance.
[352 byte] By [
flexeda] at [2007-11-27 4:19:08]

# 2
This code works for me:
ImageWriteParam iwparam = new JPEGImageWriteParam(Locale.getDefault());
iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
iwparam.setCompressionQuality(compressionRate);//Set here your compression rate
ImageWriter iw = ImageIO.getImageWritersByFormatName("jpg").next();
ImageOutputStream ios = ImageIO.createImageOutputStream(file);//file is the file you want to create
iw.setOutput(ios);
iw.write(null, new IIOImage(rendImage, null, null), iwparam);
iw.dispose();
ios.close();