Link to home
Start Free TrialLog in
Avatar of Mutley2003
Mutley2003

asked on

merging images - not exactly alphablending


Delphi Graphics experts?

Suppose I have 4 or more images - let's make it 4 for simplicity, and assume they are of equal size. I want to "composite" these images - place them on a new image in the four quadrants (bottom left,bottom right, top left, top right) - in such a way that there is a "smooth transition" between them.

So, between the top left and top right, there should be no obvious boundary... it should "look like" elements of both images are present.

This gets more complex at the center, where there are 4 (in this simple case) adjacent images.

Has anyone done this? And got nice-looking results?

Code would be nice

ASKER CERTIFIED SOLUTION
Avatar of Member_2_248744
Member_2_248744
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mutley2003
Mutley2003

ASKER

Hi Slick

Thanks for the code.. as you say, the center is likely to be a problem. I have also been thinking as to how this might be generalized to more than 4 images, and possibly irregular. OK, this is just woolly thinking so far, but bear with me.

Suppose we have a "circle of compositing" of radius R.  This imaginary circle is passed over all the pixels in the output image and determines how the original (source) images contribute to the final image.  Assume each source image is positioned in its own invisible layer, and so these layers can overlap.

Approximate the circle by a polygon, so we can use polygon calculations .. point in polygon, polygon intersection etc.

For a given pixel in the final image

* which images does it directly map to (point in polygon)
* if only one image, then copy that source pixel
* if two or more, average those pixels

* are there any pixels in the source images within the circle of compositing ie within a radius R of this one. If so, allow them to make a contribution to this pixel with weight inversely proportional to the Euclidean distance between them. Note that this means that pixels which are not on a horizontal or vertical line can still influence the output pixel.

Well, it needs some more thinking I guess.



btw I will be out of the office for about a week, so don't take my lack of response for lack of interest.
OK, I read your last comment, but I can not say that I understood it, I can not get an Idea from your description, of any concievible final or output Image, I guess that there would only be a circle (or a polygon close to a circle) with some sort of "MIX" or blending of several images, which may not all be contained in the circle, or something? Anyway, I can not get a visual in my head of what this might look like, except that it is a circle. . . I do not see any edge blending to this.

And I can not place any of this with the original request of edge blending 4 images? ? ?
Hi Slick812

I tried your code and it gives me good results. Ignore my post of 09/21/04

Thanks for the help