Gradients using MagickWand?

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply

Gradients using MagickWand?

Post by vilords » 2007-01-04T17:04:44-07:00


I would like to create a box using drawing hand ... and would like to use gradient color. It's simple when using the command line, but I'm not so sure if this could be done using magickwand (for php).

I hope someone can help.


User avatar
Site Admin
Posts: 10980
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2007-01-04T17:13:52-07:00

Gradient support for drawing in incomplete. In the mean-time you can create a linear gradient with a MagickReadImage() with a filename something like this: gradient:yellow-green. Be sure to set the gradient size with MagickSetSize().


Post by vilords » 2007-01-05T02:26:40-07:00

Thanks, I figured that out yesterday...that it can be done by using magickreadimage.

Does the latest imagick version support transparent gradients? The one I have installed now, doesn't seem to.

gradient direction - can that be done without rotating the actual image?


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

Post by anthony » 2007-01-12T00:38:54-07:00

Yes gradient can produce transparent gradients. However until SVG gradient additions are done, you will have to do the gradient rotations yourself.

Many techniques are looked at in the command line IM examples, Gradient Canvases ... /#gradient

You should be able to map these into MagicWand without too much difficulty
Anthony Thyssen -- Webmaster for ImageMagick Example Pages

Post Reply