@Override
	protected void init() {
		super.init();

		new ActionBuilder("Save Image New Format", getName())
				.withContext(ProgramLocationActionContext.class)
				.validContextWhen(plac -> plac.getLocation() instanceof ResourceFieldLocation &&
					((ResourceFieldLocation) plac.getLocation()).isDataImageResource())
				.onAction(
					plac -> saveImageAsNewImage((ResourceFieldLocation) plac.getLocation()))
				.popupMenuPath("Data", "Save Image", "As New Format")
				.buildAndInstall(tool);

		new ActionBuilder("Save Image Original Bytes", getName())
				.withContext(ProgramLocationActionContext.class)
				.validContextWhen(plac -> plac.getLocation() instanceof ResourceFieldLocation &&
					((ResourceFieldLocation) plac.getLocation()).isDataImageResource())
				.onAction(
					plac -> saveImageOriginalBytes((ResourceFieldLocation) plac.getLocation()))
				.popupMenuPath("Data", "Save Image", "Original Bytes")
				.buildAndInstall(tool);

		tool.setMenuGroup(new String[] { "Data", "Save Image" }, "A_save_image");

	}
A plugin that adds actions to manage data resources in the listing
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/resources/ResourceActionsPlugin.java