code: public void saveAsJPEG(File file, int width, int height, float quality) throws IOException, TranscoderException {
      JPEGTranscoder t = new JPEGTranscoder();
      t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new Float(width));
      t.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new Float(height));
      t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(quality));
      transcode(file, t);
    }
docs: Transcode file to JPEG.
  
  @param file Output filename
  @param width Width
  @param height Height
  @param quality JPEG quality setting, between 0.0 and 1.0
  @throws IOException On write errors
  @throws TranscoderException On input/parsing errors.