List Info

Thread: radial gradient




radial gradient
user name
2006-04-08 11:59:13
Hi nagual,

Here is just the work in progress for the radial gradients ;
I've made the prototyping (under IM license) in OCaml:
http://www.linux-nantes.org/~fmonni
er/OCaml/Magick/Gradients/Radial.1.ml.html

The 3 spread methods are there, but not the possibility to
have
more than 2 colors, nor stops offsets for these colors, but
I've found a very simple technic which seems to work to
make the antialiasing 
for the limit of the repeat spread method:
http://www.linux-nantes.org/~fmo
nnier/OCaml/Magick/Gradients/Radial.1.repeat.png

Surely it's a well known technic but I'm a beginner and I
have no knowledge
in image processing yet, so I'm very happy for having found
this 
I didn't imagined that it could be so simple to achieve
this task 

(And this technic is compatible with the linear gradient
wich was lacking
for antialiasing for the repeat spread case too.)

This radial gradient corresponds to the SVG case where there
are only 
2 stop colors, and where the center of the circle and the
focal are at 
the same point, which means cx=fx & cy=fy.

The image (produced by the code) given in link above would
be in MVG:

push graphic-context
  encoding "UTF-8"
  viewbox 0 0 320 180
  affine 1 0 0 1 0 0
  push defs
    push gradient 'RadiGrad' radial 160,90 160,90 100
      gradient-units 'userSpaceOnUse'
      spread-method repeat
      stop-color '#0044ee' 0
      stop-color '#ee4400' 1
    pop gradient
  pop defs
  push graphic-context
    fill 'url(#RadiGrad)'
    rectangle 0,0 320,180
  pop graphic-context
pop graphic-context

(to see how more complex radial gradients look:
 http://www.linux-nantes.org/~fmonnier/OCaml/Mag
ick/Gradients/MVG/ )

-- 
Best Regards
Florent
(PS: thanks to Anthony for the doc on MVG ;)

_______________________________________________
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 )