Page 1 of 1
Merging 2 wands into 1
Posted: 2007-07-22T09:58:21-07:00
by var0l
Hi,
I'm new to ImageMagick, but found it to be a great library. Now to the point. I'm trying to merge 2 MagckWands into 1 to montage them later on. How to achieve that (I've read the docs, but could not find a necessary function).
Here is a general idea of what I'm trying to do:
Code: Select all
MagickReadImage(wand1, "im1.jpg");
MagickReadImage(wand2, "im2.jpg");
(do sth with the images)
newwand = MagickMontageImage(mergewands(wand1,wand2),(...));
Please post anything that might help with this problem, else than write and read them, to a single wand. Thanks in advance.
Re: Merging 2 wands into 1
Posted: 2007-07-22T14:37:32-07:00
by el_supremo
You read each of the images in to the same magick wand and then do a montage.
Code: Select all
MagickReadImage(wand1, "im1.jpg");
MagickReadImage(wand1, "im2.jpg");
MagickReadImage(wand1, "im3.jpg");
.....
d_wand = NewDrawingWand();
p_wand = NewPixelWand();
DrawSetFont(d_wand,"Arial");
DrawSetFontSize(d_wand,12);
PixelSetColor(p_wand,"black");
DrawSetStrokeColor(d_wand,p_wand);
DrawSetFillColor(d_wand,p_wand);
newwand = MagickMontageImage(wand1,d_wand,"2x2+0+0","240x240+20+15",ConcatenateMode,"0x0+0+0");
You'll have to adjust the colours, geometry strings etc. to suit your needs.
Pete
Re: Merging 2 wands into 1
Posted: 2007-07-23T13:59:49-07:00
by var0l
I'm sorry, but you have missed the point. I know how to do a successful montage. The problem is, that before performing the montage I want to prepare the images (in a different way). E.g. floodfill the background, perform a contrast and sharpness adjustment and so on.
That is why I need two different wands (for two images). After I'm finished with preparing the images solo, I want to merge them using montage, but here I need them all in a single wand, that is why I asked the question about merging wands.
In my example that was the “(do sth with the images)” part.
Re: Merging 2 wands into 1
Posted: 2007-07-23T16:37:23-07:00
by el_supremo
OK, I think I understand now. You need to use the MagickAddImage function.
http://imagemagick.org/api/magick-image ... ckAddImage
The documentation for it appears to have a cut and paste error because it refers to a splice wand.
The images in add_wand are added to those already in wand.
Hope I understood it this time
Pete
Re: Merging 2 wands into 1
Posted: 2007-07-24T13:32:22-07:00
by var0l
Thanks very, very much. Yest this is it. I've missed it just because I was searching for the functions with a "wand" inside the name
Again thank you very much.