@Override
	public void actionPerformed(ActionContext context) {
		File file = null;
		Image image = imagePanel.getImage();

		file = getExportFile();
		if (file == null) {
			return;
		}
		try {
			exportImage(image, file);
		}
		catch (IOException ioe) {
			Msg.error(this, "Unable to save image to '" + file.getName() + "': " + ioe.getMessage(),
				ioe);
		}

	}
An action to save the image from a NavigableImagePanel to a file.
<p>
The user is asked to provide a file to save the image to.
<p>
This class uses the ImageIO library to write the image to a file;
the image format is determined by filename extension -- PNG, GIF and JPG extensions are 
recognized and honored, other extensions are ignored, and the file is written in PNG 
format. Image transparency is honored when possible.

@see javax.imageio.ImageIO
Ghidra/Framework/Docking/src/main/java/docking/widgets/imagepanel/actions/SaveImageAction.java