List Info

Thread: make a Gradient from 2 points




make a Gradient from 2 points
user name
2006-01-19 16:00:16
Hi,

As far as I know, there is not yet a function in ImageMagick
to create a gradient from 2 points, given the x/y
coordinates
for each one.

So I've tryed to make this function, and it seems to work
fine!

Here is how it works:
- give the width and height of the resulting image
- give 2 points A and B with x,y coordinates
- give the color at A and the color at B
- give the color behind A (can be the same color than at A)
- give the color behind B (can be the same color than at B)


Here is an exemple:
http://www.linux-nantes.
org/~fmonnier/OCaml/ImageMagick/gradient_from_2points.teaser
.png

which has been made with these parameters:
- width  = 200
- height = 150

- A = (x=50,  y=40)
- B = (x=150, y=110)

- color of A = "#F00"
- color of B = "#00F"

- color behind A = "#B00"
- color behind B = "#00B"

(A line has been drawn between the points A and B.)


Currently this function is written in OCaml through its
interface for
ImageMagick, but it should be possible to rewrite it in C
for the
MagickCore.  So my question is:
Are the magick-users and/or the magick-developers interested
to get the
this function in ImageMagick?

(In this case I will try to convert the OCaml code in C
code.)


-- 
Best Regards
Florent Monnier

_______________________________________________
Magick-developers mailing list
Magick-developersimagemagick.org
http://studio.imagemagick.org/mailman/listinfo/m
agick-developers
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )