3. 取り消し

Almost anything you do to an image in GIMP can be undone. You can undo the most recent action by choosing EditUndo from the main menu, but this is done so frequently that you really should memorize the keyboard shortcut, Ctrl+Z.

Undoing can itself be undone. After having undone an action, you can redo it by choosing EditRedo from the main menu, or use the keyboard shortcut, Ctrl+Y. It is often helpful to judge the effect of an action by repeatedly undoing and redoing it. This is usually very quick, and does not consume any extra resources or alter the undo history, so there is never any harm in it.

[注意] 注意

これまでの操作をひとつもしくは数手にわたって取り消したあとで、 取り消しややり直しではない何らかの新たな操作を画像に対し行なったときは、 それ以降の作業履歴は白紙に戻され、 やり直すことができなくなります。 それでは困る場合は、 その時点の画像の複製をとり、 複製画像の上で別の操作を試すのが解法です。 (原本で行なっては いけません。 なぜならば画像を複製しても作業履歴までは写し取られないからです。)

幾手もの取り消しあるいはやり直しを頻繁に行なう場合には、 作業履歴ダイアログ を使うと作業がもっと楽になるはずです。 このドッキング可能なダイアログは、 作業履歴を各時点での画像の小さなスケッチで表していて、 それを見てクリックするだけで履歴を遡ったり進めたりできます。

Undo is performed on an image-specific basis: the "Undo History" is one of the components of an image. GIMP allocates a certain amount of memory to each image for this purpose. You can customize your Preferences to increase or decrease the amount, using the System Resources page of the Preferences dialog. There are two important variables: the minimal number of undo levels, which GIMP will maintain regardless of how much memory they consume, and the maximum undo memory, beyond which GIMP will begin to delete the oldest items from the Undo History.

[注記] 注記

作業履歴は画像の一部であると申しあげましたが、 GIMP 由来の XCF 型式で画像を保存した場合でも、 画像の他の情報はどれも保存されるのに作業履歴だけは対象外です。 読み込み直した画像の作業履歴は白紙です。

GIMP の作業履歴のしくみはよく吟味して実装しました。 大多数の操作はそのメモリー消費量が極めて小さくなっており (レイヤーの可視度の変更はその例)、 作業履歴からこぼれ落ちるまでに相当な深さの手数を踏めます。 (レイヤーの可視度の変更も含め) ある種の操作は 圧縮 がかけられており、 何度も繰り返し操作しても作業履歴上ではほんのひとかけらで済んでいます。 しかし作業履歴のメモリーを多量に消費する操作もあります。 大抵のフィルター操作はこの例です。 フィルターはプラグインの一種であるため GIMP 中枢部は当然それらの及ぼした影響を知る術を持ちえません。 こうしたことから、 操作を受けたレイヤーの操作前後それぞれの全内容を保存するほかに履歴を録る手段がないためです。 こういった操作があると作業履歴からこぼれ落ちるまでに踏める手数はかなり少なくなります。

3.1. 取り消しの効かない操作

Most actions that alter an image can be undone. Actions that do not alter the image generally cannot be undone. Examples include saving the image to a file, duplicating the image, copying part of the image to the clipboard, etc. It also includes most actions that affect the image display without altering the underlying image data. The most important example is zooming. There are, however, exceptions: toggling Quick Mask on or off can be undone, even though it does not alter the image data.

画像を変更するにもかかわらず取り消せない重大な操作が僅かに存在します。

画像を閉じること

The Undo History is a component of the image, so when the image is closed and all of its resources are freed, the Undo History is gone. Because of this, unless the image has not been modified since the last time it was saved, GIMP always asks you to confirm that you really want to close the image.

画像の復帰

復帰とは画像をファイルから再読み込みするという意味です。 実際には GIMP はこの操作を、 画像を閉じてから新たに画像を起こすことで実装しており、 したがって作業履歴は失なわれます。 このような理由から、 画像が手付かずでないならば、 GIMP は本当に画像を復帰してもよいか必ず確認をとります。

操作の細分

一部のツールはその効果を得るまでに一連の手のこんだ操作を要求するのに、 取り消せるのはその全体のみで部分的に戻せないものもあります。 たとえば電脳はさみは閉じたパスを引くよう要請するので、 その通過点を次々と画像上でクリックしたうえでパスの内側をクリックして選択域としなければなりません。 しかしそれらのクリックを個々には取り消せず、 パスを完成させたあとで取り消すと、 振り出しに戻って各点のクリックから始めるしかなくなります。 他にもたとえば、 テキストを貼りつけるとき個々の文字やフォント指定などの過程だけを取り消すことはできません。 テキスト貼り付けの取り消しはそのテキストレイヤーが削除されるだけです。

Filters, and other actions performed by plug-ins or scripts, can be undone just like actions implemented by the GIMP core, but this requires them to make correct use of GIMP's Undo functions. If the code is not correct, a plug-in can potentially corrupt the Undo History, so that not only the plug-in but also previous actions can no longer properly be undone. The plug-ins and scripts distributed with GIMP are all believed to be set up correctly, but obviously no guarantees can be given for plug-ins you obtain from other sources. Also, even if the code is correct, canceling a plug-in while it is running may corrupt the Undo History, so it is best to avoid this unless you have accidentally done something whose consequences are going to be very harmful.