Page 1 of 1

how to call MagickVignetteImage ?

Posted: 2010-03-22T07:23:55-07:00
by hytgbn
I'm looking for vignette effects like adobe photoshop.

I found MagickVignetteImage function, which have 4 arguments.

But It always give me eclipsed image with white border.

I want to get black vignetted image.

How can I call MagickVignette image ? or FxImage?

Re: how to call MagickVignetteImage ?

Posted: 2010-03-22T08:52:30-07:00
by fmw42
set the background color

Re: how to call MagickVignetteImage ?

Posted: 2010-03-22T09:21:57-07:00
by el_supremo
Try incorporating this code segment into your program:

Code: Select all

	MagickWand *m_wand = NULL;
	PixelWand *p_wand = NULL;
	long w,h;

	MagickWandGenesis();

	m_wand = NewMagickWand();

        // Change the filename here
	MagickReadImage(m_wand,"chsp.jpg");

	w = MagickGetImageWidth(m_wand);
	h = MagickGetImageHeight(m_wand);

	p_wand = NewPixelWand();
	PixelSetColor(p_wand,"black");
	MagickSetImageBackgroundColor(m_wand,p_wand);
	MagickVignetteImage(m_wand,0,175,(long)(w*.05),(long)(h*.05));
The default background colour is white but you can change it as shown above.
You'll have to play with the size of the ellipse and the black and white points to get the effect you want.

Pete

Re: how to call MagickVignetteImage ?

Posted: 2010-03-23T07:07:57-07:00
by hytgbn
el_supremo // Thank you so much :)

Now I can change background color. :)

but I have one more question..


What do black point and white point mean?

I changed them but the result isn't change at all.


Image

this is the result image, it doesn't have alpha effect.

So... what do I have to check?

magick wand is created by function MagickConstituteImage

MagickConstituteImage(magick_wand, width, height, "ARGB", CharPixel, bytes);

Re: how to call MagickVignetteImage ?

Posted: 2010-03-23T09:40:23-07:00
by el_supremo
hytgbn wrote:What do black point and white point mean?
I haven't figured out exactly what their effect is on the image.
this is the result image, it doesn't have alpha effect.
Your image doesn't show up at all and I also can't download it.

Pete

Re: how to call MagickVignetteImage ?

Posted: 2010-03-24T08:22:39-07:00
by hytgbn
oops I'm sorry

this is url of image . http://www.twitpic.com/1aflvq

it doesn't effect by black point and white point arguments.

Re: how to call MagickVignetteImage ?

Posted: 2011-10-27T03:16:56-07:00
by AidenMontgomery
I know this is an old thread, but for anyone else finding it whilst searching.
el_supremo wrote:
hytgbn wrote:What do black point and white point mean?
I haven't figured out exactly what their effect is on the image.
this is the result image, it doesn't have alpha effect.
What I have figured out is that the black and white point values affect the feathering of the vignette effect.
So black = 0 and white = 255 gives a nice feathered/blended look, whereas black = 0 and white = 0 gives no feathering.

The following code gives me a nice blended vignette effect.

Code: Select all

   MagickWand *m_wand = NULL;
   PixelWand *p_wand = NULL;
   long w,h;

   MagickWandGenesis();

   m_wand = NewMagickWand();

        // Change the filename here
   MagickReadImage(m_wand,"chsp.jpg");

   w = MagickGetImageWidth(m_wand);
   h = MagickGetImageHeight(m_wand);

   p_wand = NewPixelWand();
   PixelSetColor(p_wand,"black");
   MagickSetImageBackgroundColor(m_wand,p_wand);
   MagickVignetteImage(m_wand,0,255,(long)(w*.05),(long)(h*.05));