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
vilords

Gradients using MagickWand?

Post by vilords »

Hi,

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.

Paul
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07: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().
vilords

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?

Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07: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
http://www.cit.gu.edu.au/~anthony/graph ... /#gradient

You should be able to map these into MagicWand without too much difficulty
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply