Drawing a Variable Intensity (gradient) Line

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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Drawing a Variable Intensity (gradient) Line

Post by anthony »

In topic viewtopic.php?f=1&t=21239
a line is needing to be drawn that has variable intensity.
That is very white at one point, and less white at the ends?

In that topic the line is vertical, but what if you don't want it vertical but going from specific floating point location to location?

Suggestions and solutions for a variable intensity (gradient) line?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Drawing a Variable Intensity (gradient) Line

Post by fmw42 »

Create a gradient image whose diagonal is the length of the line, with the gradient along the line. Then create a mask image with a white line on a transparent background, then composite appropriately. see http://www.imagemagick.org/Usage/canvas ... _gradients
Post Reply