Jump to content

Automatic layer alignment (via anchor points)


Recommended Posts

Hey guys,

 

I see that various similar questions have already be asked inside this forum. However, somehow I can't find the exact page that discusses this or the plugin I need for that matter.

I'm searching a way to automatically align one layer to another - but with included rotation. Eyeballing with a half-transparent layer is almost impossible because changing the size doesn't preserve the rotation anchor. So if my rotation is correct and I zoom, my previously aligned point isn't anymore. It's really frustrating.

A plugin should be possible or already exist, because basically it's just two linear operations after one another: select two points on each layer and the plugin aligns one layer to the other. The spirit level plugin is able to rotate an image according to a line the you have selected, so the basic principle is possible.

Any idea which plugin can do this? I can't imagine that it's not possible...

 

Greetings, Timo

Edited by Alpha23
Link to post
Share on other sites

I don't think that there is a plugin for this since plugins don't work with more than one layer at a time.
(Exception: If one layer is loaded into the clipboard.)

 

If I understood more clearly what you are wanting to do, there might be a more effective way of doing it manually.
 

Link to post
Share on other sites
10 hours ago, Alpha23 said:

A plugin should be possible or already exist, because basically it's just two linear operations after one another: select two points on each layer and the plugin aligns one layer to the other.

 

Nope. Plugins have access to one layer = the active one. Most plugins which need to access a second layer use the clipboard as a temporary store.

Link to post
Share on other sites

Hm, the plugin only has to:

  1. mark first and second primary point (just store the coordinates)
  2. run plugin on active layer in a plugin window (like the Spirit Level Rotate)
  3. let the user mark the first and second secondary point while showing the stored points
  4. run to align active layer (matrices to move, zoom and rotate are easy to calculate)

If I had any coding experience, I'd give it a shot. Sadly, I don't. :( But it actually it doesn't sound that complicated to me to be honest. The spirit layer rotation code is available if you need some background.

Any ideas? Anyone up for the task? Because I think such a plugin is extremely helpful - also to others! I'm almost shocked that there apparently isn't one already available... Or did I miss it?

 

Greetings, Timo

  • Upvote 1
Link to post
Share on other sites

You can create an additional layer on the top which just contains the rotation point.

 

For sure you can write a plugin where you can enter the points of the line from layer1 and align and rotate it against an other line on the active layer.

Or yo can create one plugin to store the line points on the clipboard and use this info in a second plugin. The second plugin will remember the info in the effect token.

 

midora%20signature.gif
Link to post
Share on other sites

Let me get this straight. You want something like this?

 

Asmem84.png

 

If it does, I will push it since it was 12 lines of codes. Though in this case, you would need to install the gmic plugin.

 

If you do need to find the original position, I can add that too.

Edited by Reptillian

G'MIC Filter Developer

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...