code: public ImageHandlerBuilder reduceQuality(float qualityPercent) {
           ImageWriter imageWriter = ImageIO.getImageWritersByFormatName(fn.extension()).next();
           if (imageWriter != null) {
               ImageWriteParam writeParam = imageWriter.getDefaultWriteParam();
               writeParam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT);
               writeParam.setCompressionQuality(qualityPercent);
  
               ByteArrayOutputStream baos = new ByteArrayOutputStream();
               imageWriter.setOutput(new MemoryCacheImageOutputStream(baos));
               try {
                   imageWriter.write(null, new IIOImage(image, null, null), writeParam);
                   imageWriter.dispose();
               } catch (IOException e) {
                   throw new ControllerException(e);
               }
               
               try {
                  BufferedImage lowImage = ImageIO.read(new ByteArrayInputStream(baos.toByteArray()));
                  image.flush();
                  image = lowImage;
              } catch (IOException e) {
                  throw new ControllerException(e);
              }
           }
           return this;
       }
docs: Uses compression quality of <code>qualityPercent</code>.
  Can be applied multiple times
  @param qualityPercent the percentage of compression quality wanted. Must be between 0.0 and 1.0
  @return this for chaining