docs: public static void saveImage(BufferedImage img, String fileName) {
  		try {
  			String type;
  			String a[] = fileName.split("[.]");
  			if (a.length > 0) {
  				type = a[a.length - 1];
  			} else {
  				type = "jpg";
  			}
  
  			if( !ImageIO.write(img, type, new File(fileName)) ) {
  				if( fileName.endsWith("ppm") || fileName.endsWith("PPM") ) {
  					Planar<GrayU8> color = ConvertBufferedImage.convertFromPlanar(img,null,true,GrayU8.class);
  					savePPM(color, fileName, null);
  				} else if( fileName.endsWith("pgm") || fileName.endsWith("PGM") ) {
  					GrayU8 gray = ConvertBufferedImage.convertFrom(img, (GrayU8) null);
  					savePGM(gray, fileName);
  				}else
  					throw new IllegalArgumentException("No writer appropriate found");
  			}
  		} catch (IOException e) {
  			throw new RuntimeException(e);
  		}
  	}