static BufferedImage scaleDownImageByFactor(double factor, BufferedImage img) {
  ret scaleImageWithFactor(1/factor, img);
}