Here you can find the source of createImageWriteParam(ImageWriter writer, float quality)
public static ImageWriteParam createImageWriteParam(ImageWriter writer, float quality)
//package com.java2s; //License from project: Apache License import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; public class Main { public static ImageWriteParam createImageWriteParam(ImageWriter writer, float quality) { ImageWriteParam param = writer.getDefaultWriteParam(); param.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); param.setCompressionQuality(quality); return param; }// ww w . j av a 2s. co m }