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?
how to call MagickVignetteImage ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how to call MagickVignetteImage ?
set the background color
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: how to call MagickVignetteImage ?
Try incorporating this code segment into your program:
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
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));
You'll have to play with the size of the ellipse and the black and white points to get the effect you want.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: how to call MagickVignetteImage ?
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.
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);
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.
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);
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: how to call MagickVignetteImage ?
I haven't figured out exactly what their effect is on the image.hytgbn wrote:What do black point and white point mean?
Your image doesn't show up at all and I also can't download it.this is the result image, it doesn't have alpha effect.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: how to call MagickVignetteImage ?
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.
this is url of image . http://www.twitpic.com/1aflvq
it doesn't effect by black point and white point arguments.
-
- Posts: 1
- Joined: 2011-10-27T02:57:31-07:00
- Authentication code: 8675308
Re: how to call MagickVignetteImage ?
I know this is an old thread, but for anyone else finding it whilst searching.
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.
What I have figured out is that the black and white point values affect the feathering of the vignette effect.el_supremo wrote:I haven't figured out exactly what their effect is on the image.hytgbn wrote:What do black point and white point mean?
this is the result image, it doesn't have alpha 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));