1) I have large series of files with each member of the series consisting of two PNG images. One image is the background (the form) and ones the foreground (the data fields that fill in the form).
2) They're both monochome, but I have no idea if the background color on each image is white or transparent (how to tell? does it matter?)
3) They're different sizes - the foreground is smaller than the background.
4) All I want to do is composite (overlay) the foreground and background, preserving everything in each image, and stretching the width of the foreground to make it the same as the width of the background (so they overlay evenly). The result should look like a filled-in form.
I'm having real problems with this and think I'm just having conceptual difficulties understanding IM's model.

What am I doing wrong here? Most of what I've tried is variations on:
# convert background.png foreground.png -gravity center -flatten newimage.png
thanks for any help and pointers.