Not 100% sure what you mean by 'overlap' but if it's either morphing two images or making a 'montage', here's a couple of tricks using the CPAN module
Image::Magick:
The
article is in German, but the perl code and the resulting images should be self-explanatory.