Alpha23 Posted April 1, 2021 Share Posted April 1, 2021 (edited) 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 April 1, 2021 by Alpha23 Quote Link to comment Share on other sites More sharing options...
ardneh Posted April 1, 2021 Share Posted April 1, 2021 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. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted April 2, 2021 Share Posted April 2, 2021 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. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Alpha23 Posted April 2, 2021 Author Share Posted April 2, 2021 Hm, the plugin only has to: mark first and second primary point (just store the coordinates) run plugin on active layer in a plugin window (like the Spirit Level Rotate) let the user mark the first and second secondary point while showing the stored points 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 1 Quote Link to comment Share on other sites More sharing options...
midora Posted April 2, 2021 Share Posted April 2, 2021 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. Quote Link to comment Share on other sites More sharing options...
Reptillian Posted April 2, 2021 Share Posted April 2, 2021 (edited) Let me get this straight. You want something like this? 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 April 2, 2021 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Alpha23 Posted October 13, 2022 Author Share Posted October 13, 2022 (edited) Alright, somehow I need to come back to this, now that I got the time to. Here's a mock-up of what I'm envisioning relating to the attached pictures Step 1: choose anchor points on image 1 Step 2: choose anchor points on image 2 Step 3: let the plugin align those two points together with the layer (linear transformation through a rotation matrix on one layer only) Example: P1a=(731,1047), P2a=(1319,620) P1b=(745,999), P2b=(1359,536) The resulting zoom-rotation matrix is calculated as (1.0281, -0,0043 -0.0098,0.8737) (internally with more decimal places of course) and applied to the second picture. Both points are now exactly on top of each other - done. I don't know how to write plugins but it doesn't strike me as particularly complicated... Edited October 13, 2022 by Alpha23 Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted October 13, 2022 Share Posted October 13, 2022 Why not lower the opacity of the top layer and eyeball it? This took less than a minute.... 2 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Alpha23 Posted October 17, 2022 Author Share Posted October 17, 2022 Simple: I need to do this to around 2,500 picture pairs. 😉 Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted October 17, 2022 Share Posted October 17, 2022 PDN 5.0 will enable G'MIC to read from all layers, so this would probably be easier to accomplish then. (in private testing, PDN 5 already has this working, and there's a private build of G'MIC that's updated to do this) However, there's no automation or batch processing ... 1 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Alpha23 Posted October 20, 2022 Author Share Posted October 20, 2022 While that is certainly great news, it's not even necessary in my case: setting one layer to overlay and applying the plugin to only one layer will let you see and select all four points on the layer you'd like to transform. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.