[Image-SIG] Generating and puting images over images

kcaza@cymbolic.com kcaza@cymbolic.com
Fri, 16 Jun 2000 09:08:47 -0700


The Image.paste command should work fine, but you may want to look into using an
image mask to do it.  Using a mask, you can paste odd-shaped regions of an
image, or paste an image semi-transparently over another.

All you need is a grayscale image file the same size as both images, where you
paint the mask in black/white/gray.  When you paste the two real images
together, specify the mask as well.

ImA = Image.open ("background.tif")
ImB = Image.open ("foreground.tif")
ImC = Image.open ("grayscale_mask.tif")

ImD = ImA.paste(ImB, (0,0), ImC)

ImD.save("combined.tif")

Kevin Cazabon






"Marcus Mendes" <mvmendes@mailcity.com> on 06/16/2000 04:55:27 AM

Please respond to mvmendes@mailcity.com

To:   image-sig@python.org
cc:    (bcc: Kevin Cazabon/cymbolic/gig)

Subject:  [Image-SIG] Generating and puting images over images




Hello,

I have a map with various positions defined, ie, my map is divided in many small
parts with its numbers (I think that seems as an array of small images). My
mission is put another image over each these small images, leaving them as
background images.

I asked : Should I use an array of these images? And how can I to do it?

Someone can help me?

Thanks in advance.

Marcus


Send FREE Greetings for Father's Day--or any day!
Click here: http://www.whowhere.lycos.com/redirects/fathers_day.rdct

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://www.python.org/mailman/listinfo/image-sig