3. Desfazendo

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.

[Cuidado] Cuidado

Se você desfizer uma ou mais ações e operar na imagem de alguma forma, exceto usando Desfazer ou Refazer, deixará de ser possível refazer essas ações: elas serão perdidas para sempre. A solução, se isso for um problema para você, é duplicar a imagem, depois de desfazer até o ponto desejado, e testar as novas operações na cópia. (Não testar na imagem original, porque o histórico de desfazer/refazer não é copiado quando você duplica uma imagem.)

Se você costuma ficar desfazendo e refazendo muitos passos de cada vez, pode ser mais conveniente para trabalhar com o diálogo de Histórico do Desfazer, um diálogo de encaixe que mostra um pequeno esboço de cada ponto no Histórico de desfazer, permitindo-lhe voltar ou andar pra frente até esse ponto, só clicando no mesmo.

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.

[Nota] Nota

Mesmo que o Histórico de desfazer seja um componente de uma imagem, ele não é salvo quando você salva a imagem usando o formato XCF nativo do GIMP, que preserva todas as outras propriedades da imagem. Quando a imagem é reaberta, ela terá um Histórico do desfazer vazio.

A implementação de Desfazer do GIMP é bastante sofisticada. Muitas operações exigem muito pouca memória para Desfazer (por exemplo, alterar a visibilidade de uma camada), para que você possa realizar longas sequências delas antes que elas saiam do histórico de desfazer. Algumas operações, como alterar a visibilidade da camada, são compactadas, para que fazê-las várias vezes em uma série produza apenas um único ponto no histórico de desfazer. No entanto, há outras operações que podem consumir uma grande quantidade de memória para desfazer. A maioria dos filtros são implementados por plug-ins, desta forma o núcleo do GIMP não tem nenhuma maneira eficiente de saber o que mudou. Como tal, não há maneira de implementar Desfazer exceto memorizando os conteúdos inteiros da camada antes e depois da operação ser executada . Pode ser que você seja capaz de realizar apenas algumas dessas operações antes delas saírem do histórico do desfazer.

3.1. Coisas que não podem ser desfeitas

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.

Existem algumas ações importantes que alteraram uma imagem e não podem ser desfeitas:

Fechar a imagem

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.

Reverter a imagem

Reverter significa recarregar a imagem do arquivo. O GIMP implementa isso fechando a imagem e criando uma nova imagem, e portanto, o histórico de desfazer é perdido como consequência. Devido a isso, se a imagem foi alterada, o GIMP lhe pede para confirmar se você realmente quer reverter a imagem.

Pedaços de ações

Algumas ferramentas requerem que você realize uma série complexa de manipulações antes que eles entrem em vigor, mas só permitem desfazer a coisa toda em vez de elementos individuais. Por exemplo, as Tesouras Inteligentes exigem a criação de um caminho fechado, clicando em vários pontos na imagem, e em seguida, clicando no interior do caminho para criar uma seleção. Você não pode desfazer os cliques individuais: desfazer depois que você termina leva todo o caminho de volta ao ponto de partida. Em outro exemplo, quando você está trabalhando com a ferramenta de texto, você não pode desfazer letras individuais, alterações de fonte, etc: desfazer depois que você termina remove a camada de texto recém-criada.

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.