Assuming your environment is Mac OSX or Linux or Unix...
Then you could this:
for img in A/* ; do \
convert \
A/${img} \
B/$(basename ${img}) \
-gravity center \
-compose blend \
-composite \
-alpha set \
composed.png \
done
Now you have to understand: the description of your requirement is very, very unclear. Some questions remain:
- Do the respective images of the same width/height dimensions?
- Are they in the same file format? Do they use transparency/alpha channel?
- How exactly do you want the superimposition to work?
There are a lot of different methods to superpose two images. To see the complete list, look at the output of this command:
convert -list compose
In my installation it shows 67 different methods:
Atop Blend Blur Bumpmap ChangeMask Clear ColorBurn ColorDodge Colorize CopyBlack CopyBlue CopyCyan CopyGreen Copy CopyMagenta CopyOpacity CopyRed CopyYellow Darken DarkenIntensity DivideDst DivideSrc Dst Difference Displace Dissolve Distort DstAtop DstIn DstOut DstOver Exclusion HardLight HardMix Hue In Lighten LightenIntensity LinearBurn LinearDodge LinearLight Luminize Mathematics MinusDst MinusSrc Modulate ModulusAdd ModulusSubtract Multiply None Out Overlay Over PegtopLight PinLight Plus Replace Saturate Screen SoftLight Src SrcAtop SrcIn SrcOut SrcOver VividLight Xor
My example command above uses only one of these, -compose blend
.
You need to experiment with the different composition methods to see which one matches your idea. Here is a little illustration which shows you how some of the methods work when applied to two very simple shapes:

Before you start, you could look up and read a bit about the effects of the different methods: