private static File getExportFile() {

		GhidraFileChooser chooser = new GhidraFileChooser(null);
		chooser.setTitle("Export Image As...");
		chooser.setApproveButtonText("Save As");
		chooser.setFileSelectionMode(GhidraFileChooserMode.FILES_ONLY);
		chooser.setMultiSelectionEnabled(false);

		File selected = chooser.getSelectedFile(true);
		chooser.dispose();
		if (chooser.wasCancelled()) {
			return null;
		}

		return selected;

	}
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