This is from the top of my head, so it may not work, but I hope it helps

Probably a little inefficient, but it's a start.
rem setup screen
sync on
sync rate 60
backdrop on
color backdrop 0
show mouse
rem load images
load image "alphamap.bmp",1
load image "tex1.jpg",2
load image "tex2.jpg",3
rem make memblocks from textures to fuse
make memblock from image 1,1
make memblock from image 2,2
rem get size of image
ImageWidth=memblock dword(2,0)
ImageHeight=memblock dword(2,4)
rem make a memblock for fusing
make memblock 3,ImageWidth*ImageHeight*32+12
rem fuse images
pos=8
for y=0 to ImageHeight-1
for x=0 to ImageWidth-1
inc pos,4
write memblock byte 3,pos+0,memblock byte(2,pos+0)
write memblock byte 3,pos+1,memblock byte(2,pos+1)
write memblock byte 3,pos+2,memblock byte(2,pos+2)
write memblock byte 3,pos+3,memblock byte(1,pos+2)
next x
next y
rem get new image
make image from memblock 4,3
rem clean up
delete image 1
delete image 2
delete memblock 1
delete memblock 2
delete memblock 3
rem main loop
do
rem display images
paste image 3,0,0
paste image 4,0,0,1
rem refresh screen
sync
rem end of main loop
loop
Note that both images have to be 32-bit images, and the alphatex has to be the greyscale version of the alpha channel, or this won't work.
This is how it works. Each pixel in an image containes 4 bytes of data (32 bits). red, green, blue, and alpha. This can be displayed as a hexadecimal value:
FF FF 80 00
The first FF is the alpha channel, so FF would be the maximum (no transparency). The next FF is for red (full red), 80 for green (half green), and 00 for blue (no blue). So that pixel would be orange. What my code does is it takes the color data from the texture, takes the alpha channel from the alpha map, and writes it together:
tex1 : FF
A2 67 C9 <-- texture
alpha: FF
B1 B1 B1 <-- grey scale alpha
final image :
B1 A2 67 C9
TheComet