Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I move a layer to a specific XY position within the canvas in Gimp?

Currently, the only way I can find is to just eyeball it with the guides and/or mouse position. I want to specify the exact X and Y coordinates.

share|improve this question
    
I want to know this too, or how to do it in Photoshop. I made a question for that. superuser.com/questions/345669/… –  Jonny Oct 12 '11 at 10:21
1  
Does not seem to be (easily) possible in GIMP without using Python code as detailed below: graphicdesign.stackexchange.com/a/6813/8841 –  SabreWolfy Dec 2 '12 at 9:00
add comment

3 Answers 3

There is a script to do this that can be download from the GIMP Plugin registry. It is called: "Move Layer To" http://registry.gimp.org/node/27806

share|improve this answer
    
Nice first answer! –  slm Jan 7 '13 at 4:21
    
Almost perfect! Would be nice if the parameter dialog used the layer's current coordinates as the default values. –  Oliver Giesen Jan 25 '13 at 23:39
1  
You need to download that .scm file and put it into %USERPROFILE%\.gimp-2.8\scripts on Windows, then do Filters->Script-Fu->Refresh Scripts and it will be available as the bottom most item Layer->Move To –  DarkWalker Jan 10 at 20:00
    
Not exactly "move a layer", but related: there is "pastexy.py -- Paste the clipboard at location X,Y" from the post: Pasting at a specific location - comp.graphics.apps.gimp –  sdaau Jul 17 at 7:35
add comment

I'm using GIMP 2.6.11.

With these lines of Python the active layer can be moved to an absolute position, like (32, 64), from the Python console:

>>> x_new = 32
>>> y_new = 64
>>> img = _[0]
>>> layer = img.active_layer
>>> x_off, y_off = layer.offsets
>>> pdb.gimp_layer_translate(layer, x_new - x_off, y_new - y_off)

Alternatively, if you only want to move the content of the layer:

right-click, Layer > Transform > Offset

or Shft+Ctrl+O

share|improve this answer
1  
This causes the pixels within the layer to move, rather than the layer itself - I need to move the actual layer. What you suggested may work if the layer is the same size as the canvas, or at least big enough not to clip any non-transparent pixels within the layer. –  Scott Jul 7 '11 at 19:55
    
@Scott: I see - sorry I didn't find an easier way, but at least I figured out how to move the layer to an absolute position with some lines of Python. –  Nicolas Kaiser Jul 7 '11 at 21:32
2  
Line three of you code should be img=gimp.image_list()[0]. The _ didnt work for me. –  apple16 Jul 23 '12 at 21:58
add comment

I am afraid that Gimp doesn't include it because it is tedious. It is simple not the appropriate way of align when you are design. I recognize that sometimes is useful as a short-cut. The best approach is with guides:


A) Step 1 - Create the guides

  1. Go to Image->Guide->New Guide
  2. Specify if you want and horizontal or vertical guide
  3. Specify the number of pixels
  4. Repeat the procedure for another horizontal or vertical Guide (you can also do more guides to specify width and height)

Alternatively, you can also create the guides dragging from the rulers:

  1. Drag down (starting from the top ruler) a guide to the Y coordinate you want.
  2. Drag down (starting from the left ruler) a guide to the X coordinate you want.

B) Step 2 - Move the canvas

You can use the moving tool.

  1. Select your Layer
  2. Go to Tools -> Transform Tools -> Move
  3. Drag the Layer to the guides. Gimp will give you a hand with the exact pixels.

One of the design principle is that you should have things align in your whole project. Reducing the number of aligns (guides) helps you to get a cleaner design. I think that is why gimp does not include a tool to specify the exact coordinates. If you want to follow this design principle specify guides one by one becomes just a tedious labour.

share|improve this answer
    
Exactly what I need - thanks. Use case: creating a wallpaper for dual-head setup from two other wallpapers. :) –  smbear Dec 10 '13 at 11:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.