Lay one image on top of another with transparency?
Posted: 2007-01-26T11:46:55-07:00
I know this is simple but I can't find any sample code and am getting frusterated.
I have 2 images. IMAGE1 is a JPG that is a photo. IMAGE2 is a JPG or GIF (whichever is easier) that is the same size and IMAGE1 and has, say, a logo in the bottom right corner and a border strip along the bottom with tagline or something - everything else is set to an RGB value I want to be transparent.
I need to lay IMAGE2 on top of IMAGE1 but with all pixels that are not the logo/tagline set to transparent. For example, IMAGE2 might be all limegreen except for the logo. I need to know how to make that limegreen color (or whatever RGB value I determine to be the "transparent color") transperent and then lay IMAGE2 directly on top of IMAGE1.
I have found a few workarounds with going pixel by pixel and such, but I will be doing this to thousands of photos at a time and I am thinking there is a function that does exactly what I need in an efficient manner. I just cannot figure out which one it is!
Ideas?
Jenn
I have 2 images. IMAGE1 is a JPG that is a photo. IMAGE2 is a JPG or GIF (whichever is easier) that is the same size and IMAGE1 and has, say, a logo in the bottom right corner and a border strip along the bottom with tagline or something - everything else is set to an RGB value I want to be transparent.
I need to lay IMAGE2 on top of IMAGE1 but with all pixels that are not the logo/tagline set to transparent. For example, IMAGE2 might be all limegreen except for the logo. I need to know how to make that limegreen color (or whatever RGB value I determine to be the "transparent color") transperent and then lay IMAGE2 directly on top of IMAGE1.
I have found a few workarounds with going pixel by pixel and such, but I will be doing this to thousands of photos at a time and I am thinking there is a function that does exactly what I need in an efficient manner. I just cannot figure out which one it is!
Ideas?
Jenn