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 »


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: 11064
Joined: 2003-05-31T18:32:55+00:00

Post by magick »

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 »

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: 8883
Joined: 2004-06-01T02:27:03+00:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

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