I am trying to overlap two images with imagemagick. I have enclosed 2 images radar1.png and radar2.png.
Now the trick is that radar1.png needs to go over radar2.png. When I do this with:
composite radar1.png radar2.png radarend.png
the image is overlayd but you can see that they do not blend nice together. On the border areas of the radar2.png image I would like to get a blended section. In the radarendred.png I marked by hand the areas I mean. This effect can happen in the whole border/overlapping area. In those areas where there is no overlap I want to retain the original colors. Is there a way to blend the colours of the two images in a way that those border areas are more smooth brought together.
The data can be found on http://www.dhrvc.nl/samples.zip
I hope you can help.
Kind regards
Stefan
overlaying 2 images partly
-
- Posts: 2
- Joined: 2014-01-27T14:02:59-07:00
- Authentication code: 6789
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: overlaying 2 images partly
Assuming you alpha channels are binary, apply a slight blur to the alpha channels to smooth the blending at the edges of the two regions before compositing (or at least the alpha channel of the top image). try
convert background \( foreground -alpha on -channel a -blur 0x1 +channel \) -compose over -composite result
increase the blur if needed or desired. The above is unix syntax. On Windows
convert background ( foreground -alpha on -channel a -blur 0x1 +channel ) -compose over -composite result
convert background \( foreground -alpha on -channel a -blur 0x1 +channel \) -compose over -composite result
increase the blur if needed or desired. The above is unix syntax. On Windows
convert background ( foreground -alpha on -channel a -blur 0x1 +channel ) -compose over -composite result
-
- Posts: 2
- Joined: 2014-01-27T14:02:59-07:00
- Authentication code: 6789
Re: overlaying 2 images partly
You mean like this?
composite radar1.png ( foreground -alpha on -channel a -blur 0x1 +channel ) -compose over -composite radar3.png
It gives errors on the images. So input is radar1.png and my output name is radar3.png. I think I am misunderstanding your syntax.
Regards
Stefan
composite radar1.png ( foreground -alpha on -channel a -blur 0x1 +channel ) -compose over -composite radar3.png
It gives errors on the images. So input is radar1.png and my output name is radar3.png. I think I am misunderstanding your syntax.
Regards
Stefan
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: overlaying 2 images partly
That should becomposite radar1.png ( foreground -alpha on -channel a -blur 0x1 +channel ) -compose over -composite radar3.png
convert radar2.png ( radar1.png -alpha on -channel a -blur 0x1 +channel ) -compose over -composite radar3.png
where I am using the convert syntax, which is more current and more flexible. Note the order of the two images is reversed in convert syntax.
see
http://www.imagemagick.org/Usage/compose/#compose