Question: I have two different pictures of the same object, one of which is taken from roughy the same angle but has a different scale and rotation. I want both images to overlap so that the upper one matches the lower one as exactly as possible. Is there any option in gimp where I can define a number of key points and gimp aligns the images according to these points? For example I say that corner X in picture 1 has to match corner Y in picture 2. It should be sufficient to define 3 such points in each image to get a good result already.

If it is not possible, what would be the best way to reach this goal aside from just scaling and rotating until it looks ok?

Answer: 
It looks like [panotools](http://panotools.sourceforge.net/) has a [Gimp plugin](http://sourceforge.net/projects/panotools/files/gimp%20plugin/). I haven't used it, but it's there.

Outside of GIMP, but still free, you might want to try going down different roads.

[**Hugin**](http://hugin.sourceforge.net/) - Primarily targetted at panorama stitching, you can use this to [align and scale an image stack](http://wiki.panotools.org/Align_image_stack) for HDR or exposure blending or time-lapse videos or...

[**Registax**](http://www.astronomie.be/registax/) - Aimed at astrophotographers, this free software will take multiple images (a few stand-alone or thousands of video frames), rotate, scale, and align them. Beyond that, it can (optionally) use very sophisticated techniques to combine the component images into a final image.

[HDR Alignment Tool](http://www.flickr.com/photos/58368129@N00/210213524/) - Another possibility. It does alignment, rotation, and scaling. Might be worth a try. A [comparison](http://www.flickr.com/photos/longjiang/531171093/) to Photomatix auto-alignment (in 2007, mind you) seems to favor HDRAT.

[DeShaker](http://www.guthspot.se/video/deshaker.htm) - Another way to approach aligning smaller images (up to 1080p resolution), this free software does video stabilization. If you were to combine the two images into a two-frame movie, this would align them. Probably not what you want, but it's a technique that's been used for aligning still images.
You can use Filter|G'MIC|Layers|Align Layers. You must select Input Layers: All before executing. Take into account that this is a time consuming operation.