public void saveImage() {
		if (history.isEmpty()) {
			System.out.println("No image to save");
			return;
		}
		JFileChooser jfc = new JFileChooser();
		jfc.setDialogTitle("Choose an Image");
		jfc.showDialog(null, "Done");
		jfc.setVisible(true);
		File file = jfc.getSelectedFile();
		if (file == null)
			return;
		String filePath = file.getAbsolutePath();
		if (!filePath.endsWith(".png")) {
			filePath = filePath + ".png";
		}
		File outputFile = new File(filePath);
		try {
			ImageIO.write(history.get(historyIndex), "png", outputFile);
		} catch (IOException e) {
			System.out.println("Failed to write to file :(");
		}
	}