Aligning layers

Hi all …

could you please kindly someone educate me and tell me which method (tool) is supposed for to align two layers when they are a bit irregular and you need to deform one a bit to match the layer below or above - eg bracketed shot from hand …

For example these two images cannot be properly aligned - branches against a bright sky dont fit perfectly on the left and right side …

https://infophagia.com/ntz/paste/DSC00496.JPG
https://infophagia.com/ntz/paste/DSC00497.JPG

there needs to be done some deformation over one of layers (I have lighter/496 as base on the bottom and aligning the darker/497 on the top) but I am unable to do it right and easily so I believe I am missing something crucial …

I was trying with gimp’s Perspective tool' or Handle Transform Tool’ …

On high level I would expect that I will align one side then somehow pin it and align the other side …

thanks much and regards, ~d

I do not think you will get there with GIMP, there are plugins where you set two points on each image and get a result where the two points match. That is a bit crude for your requirements.

The term to search for is image registration. A good free tool for this is the JAVA program figi https://imagej.net/software/fiji/ which has several options for registration.

I tried out your images using the elastic option. This is the …97 image Open the …96 image then open-as-layers the attached image. See if the alignment is acceptable. There is only a few pixels movement required Using Gimp you fix two corners and the center suffers,

1 Like

hi,

thanks much for your input … yes, this seems to be what I am looking for … it’s aligned perfectly (for my tastes) … so you did this with mentioned fiji ? I was also looking on hugin, seems he can somehow do it also (I’ve tried but yet I don’t understand how it works because it was not working for me as I’ve expected) …

It would be super-cool to have this fiji-like plugin (with mentioned elastic option) integrated into gimp …

thank you very much for your input sir !!

Could you please kindly guide me a bit howto replicate what you did ? My dearest apologize, I am not exactly a technical person … I assume that I should use

  • File → Open // will open here a bottom image, in my case lighter 496
  • Plugins → Registration → Elastic → Elastic Stack Aligment

but I don’t know how should I apply that elastic registration on another image …

thanks much

I was going to suggest the G’MIC plugin Layers>Align but your images didn’t work with that - the GIMP froze.

Plus you mentioned deformation … so - as already been said - I too would use something like Hugin (align_image_stack.exe) …

1 Like

I tried again with quarter-size images and it completed the task. However, the layers did not get fully-aligned.

The thing about Hugin and the like is that the software finds “control points” all over the images where small details are the same; then it lines up all those control points applying the necessary distortions between them.

rich2005’s solution with ImageJ2 seems almost perfect - no need to look further :smiley: … I am still waiting for his reply because I am a little bit confused howto use Plugins → Registration → Elastic to replicate that …

Ok, 'bye …

please don’t take it any personal … original goal was to align layers while some kind of layer distortion or alike modification is required … hugin can’t do that right as you admitted above … if hugin can employ a similar kind of elastic aligning as rich2005 proved in his post above then I would love to stick with hugin …

edit: wait - so hugin can do it also ??? o.O … I am confused, looking at your samples … they are not an original size … ok, then a quality and effectiveness comes into play also … I will be modifying like that mostly ?16bit tiff files from RT or DT which are pretty big (100-200MBs)

I have just demonstrated that Hugin aligns images very well, even yours. It was not necessary for me to demonstrate your images at full size to show that and neither was it necessary to demonstrate “a quality” - only the effectiveness of alignment which far exceeds that of “stretching” in ImageJ aka Fiji.

Please consider my unsatisfactory demonstration withdrawn.

Sorry my mix-up. I tried a few things (NIP2…) to see what might be best and it was getting late.
The Fiji plugin for that image is bUnwarpj
Open the two images, run the plugin, it is slow so be patient.
Eventually shows two images Registered Source Image-2.jpg and Registered Target Image-1.jpg
These are not automatically saved, up to you to save.

For Gimp a plugin that matches two points on each image try ofn-layer-aligner.py from Ofnuts' Gimp Tools - Browse /scripts at SourceForge.net
This will rotate and scale but is really meant for matching overlaps rather than a stack.

If Hugin works, so much the better. (I still use an ancient AutoPanaGiga)

2 Likes