11 March 2008

How to Extend Image with GIMP

If you have an image with a plain background that is too short or narrow, here's how you can extend it using GIMP 2.x. Note that extending an image is not the same as stretching an image using a transformation; important elements in the image are not distorted, just moved (see ASCII art below).

+----+     +------+
|A  B| ==> |A    B|
+----+     +------+
  1. Open the image file.
  2. Select menu item Image / Canvas.
  3. In Set Image Canvas Size dialog, uncheck the link between Width and Height, enter the required dimensions, then press the Resize button.
  4. Select menu item Layer / Layer to Image Size. You have to extend the background layer because you cannot see any part of the image beyond the background layer's boundaries.
  5. Use Rectangle Select Tool, select area to move, then copy selection to clipboard.
  6. Paste selection into image (which creates a Floating Selection in the Layers dialog).
  7. Move the selection to the required position in the layer. If you want to precisely place the selection, you should zoom in and use the cursor keys.
  8. When you are satisfied with the position of the selection, use Layer / Anchor Layer to put it back into the background layer.
  9. Use the Color Picker Tool to select a colour, then use a Pencil Tool or Paintbrush Tool to touch up the background.

Note that you can only move the selection after you have created a Floating Selection, which confused me initially because I thought that just copying a selection would give me an object to move.