anthony wrote:Hold on Fred. As Cristy said before, it would be hard to figure out an option set that would continue to allow easy use (like gradient: does currently) with all the numerous options that users may like to have available.
I'm not saying that it isn't possible, just a lot more work. If you can come up with some structure for the original 'gradient:' with 'styles', 'color-stops' and 'repeat' methods. that still allows the current 'easy to use' defination, especially if it better corresponds with SVG, then maybe, someone might take time to implement it.
At the moment Cristy is just trying to get SVG and MVG gradients working, which is a more important first step. The radial-gradient: feature was just something he mentioned above and I took a look at. I was suprised it had even been added.
I just felt changing the outer point from a corner to some fixed edge (top would be most logical) would at least allow users to better define the radius, and make the whole gradient visible. And it was better for such a change to be made as early as posible.
And any other 'options' would have entailed a lot more work, and make it different to the other two gradient image generators gradient: and plasma: which is basically a fractal color distortion on top of the normal gradient: base image.
I too like to see a lot more options. But I prefer to get the SVG gradient working for most. However if Cristy wants I'll jump into the code radial-gradient code and change it as I suggested. Or if you can come up with a good 'options' method. I'll gladly try to implement it to. But most importantly it must fall back to easy to use, just as gradient: has been for the last decade.
Think about it and wour out some scheme to implement it using a simple but expandable string.
Remember currently you can specify a gradient as
''
'{one_color}'
'{one_color}-{two_color}'
See IM examples for an indication of how these three styles currently work.
Anthony and Magick,
I am in no hurry and can be patient with all the development.
I do understand and was just surprised when I saw that radial-gradient: was implemented, since I suggested to Magick that he not spend his valuable time implementing a separate option. It was not terribly important, although it could prove valuable in the future for FFT filters.
I just wanted to point out some other options to think about. I will certainly give some more thought to it and offer any suggestions that I come up with. But again it is not that urgent.
As for the current implementation, I would say that stopping at the sides was slightly more preferable to the corner for a square image. However, as a default, as it might be used for a lookup transformation, it would be preferable to have it go from black (0) at the center to white (quantumrange) at the sides. However, this is just a -negate from what you currently show (unless you implement it as radial-gradient:innercolor-outercolor so that it could be radial-gradient:black-white, for example). Seems like your examples show that you already have the one or two color forms in place, so this is likely a non-issue.
The other thing that would be important for use as FFT filter is that the center needs to match the center of the FFT. For FFT images, they need to be even dimensions and the center (DC point) is at M/2,N/2. I do not know how you are computing the center now for the current radial-gradient.
For non-square images, as I said before, one would like to have the option of having the radius correspond to either the smaller or larger side. But this is another parameter. Also the elliptic form would be nice.
All these are indeed a lot of parameters and so perhaps might be better implemented via -draw where you can specify such more easily. However, apart from the center issue. One could have:
radial-gradient-small: for the smaller dimension
radial-gradient-large: for the larger dimension
radial-gradient-corner: for the one that goes to the corners
elliptic-gradient: for the elliptical shaped gradient
Another way to have the equivalent cases would be somewhat similar to -distort (but allowing text parameters within the quotes, not just coordinates):
-radial-gradient circle-or-ellipse "outercolor [innercolor] [small-or-large-or-diag] [xcenter,ycenter]"
The defaults would be one color (outercolor), small indicating radius to smaller dimension, and exact center.
A two color gradient would be:
-radial-gradient circle "outercolor innercolor" with radius to smaller dimension and exact center.
A gradient to the diagonal would be:
-radial-gradient circle "outercolor diag"
A gradient for a non-square image to larger dimension (as the default would be small) would be:
-radial-gradient circle "outercolor large"
An elliptic gradient for a non-square image would be:
-radial-gradient ellipse "outercolor"
An offcenter radial gradient to the closest edge for a 100x100 image would be:
-radial-gradient circle "outercolor 70,70"
this would make a radius=30 gradient so that the "circle" just touched the closest edge
These are just some off the top ideas for consideration. I don't suggest that you put a lot of effort into it at this time and certainly don't know what is feasible, practical or worth the effort.
I just wanted to put some ideas forth for consideration while this is being developed rather than after the fact. And again none of this is high priority.
Thanks
Fred