Using Wave operator on an image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
praviarun

Using Wave operator on an image

Post by praviarun »

Hi All,

I would like to use wave operation on an image using magic++ api..After the wave operation the source image is resized because the virtual pixels are taken into account..This increases my image size and also gives me undesirable alpha information at the vertical edges of the image..How can I avoid this..I tried setting the virtual pixel method to TransparentVirtualPixelMethod but this does not seem to work..
Please help...

Ive attached this link which describes the problem....

http://docs.google.com/View?id=ddz3n2dw_0hs9zkdcj

The vertical edges of the result image(after wave operation) has alpha in the black regions which is undesirable..

Praveen
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Using Wave operator on an image

Post by anthony »

The API wave function is the same as for the command line version exampled at
http://www.imagemagick.org/Usage/warping/#wave

The Wave function does not use -virtual-pixel, but simply fills the added area with the -background color that is assigned to the image it is given.


Set the background color of the image, then pass it to the wave function.

It will always add amplutide pixels to the top and bottom of the results, whcih you can then Crop or Extent off if that is not wanted.

So you have two solutions!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
praviarun

Re: Using Wave operator on an image

Post by praviarun »

Hi,
Thanx for the reply...

Ok, I get it..but doesn't the wave function take the background alpha into consideration while filling the added area...

Regards
Praveen
Post Reply