I've studied the polar angular gradient magic described @ http://www.imagemagick.org/Usage/canvas ... nt_distort, but just haven't a clue how to do what I want:
An arc gradient from with the same color @ the start and end of the arc.
Is this possible? Can anyone get me close? Thank you!
Polar angular gradient color1 -> color2 -> color1
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Polar angular gradient color1 -> color2 -> color1
There are various ways to do this. I assume you want a constant colour from the centre to the edge.
Suppose you want a red-lime-red gradient (lime = pure green), spanning 90 degrees in total, starting 10 [EDIT: I mean 20] degrees clockwise from north. Windows BAT syntax:
Your "don't care" area is transparent black. Change the "-virtual-pixel" setting if you want. Remove it entirely to get the colour all over the rectangle, with red in the "don't care" area.
This gives a 402x402 output. Scale the 200 and 300 numbers, in the same ratio, for different sizes.
Suppose you want a red-lime-red gradient (lime = pure green), spanning 90 degrees in total, starting 10 [EDIT: I mean 20] degrees clockwise from north. Windows BAT syntax:
Code: Select all
convert ^
-size 200x300 ^
gradient:red-lime ^
-rotate -90 ^
( +clone -flop ) +append ^
-virtual-pixel None ^
+distort Polar 200,0,300,200,20,110 ^
+repage ^
-flip ^
arccol.png
Your "don't care" area is transparent black. Change the "-virtual-pixel" setting if you want. Remove it entirely to get the colour all over the rectangle, with red in the "don't care" area.
This gives a 402x402 output. Scale the 200 and 300 numbers, in the same ratio, for different sizes.
snibgo's IM pages: im.snibgo.com
Re: Polar angular gradient color1 -> color2 -> color1
Thank you snibgo!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Polar angular gradient color1 -> color2 -> color1
Pleasure. There was a typo in my text, now corrected.
snibgo's IM pages: im.snibgo.com