Tom Rathborne wrote [Sun Feb 20, 20:27 ]:
> <snipped...>
> Yes, but you haven't gone far enough.
>
> Each colour at a gradient node should be customizable through an
> expression language (like in MathMap), so instead of gradients like
> 'Tube_Red', there would just be 'Tube'. The highlight for 'Tube' could
> be 'hsv(fg.h,sqr(fg.s),sqrt(fg.v))', the shadow edge could be
> 'rgb(fg.r/2,fg.g/2,fg.b/2)', and the deepest shadow could be 'bg'.
> Then you set the FG and BG colour and get a tube gradient based on
> those two colours.
>
> (Note that my sample expressions think of colour value on the range
> 0.0-1.0 so sqr() makes a value smaller and sqrt() makes it bigger.)
>
> Just an idea :)
Kind of like gradient templates. I was wondering if C++ was
going to work its way into this project one way or another. ;)
For intuitive use, I'm partial to the idea of
(1) Mouse down at some point in the image (start generating a line
indicia, a.k.a. <Shift>brush tool or measure tool)
(2) Mouse up at some other point in an image.
(3) Plot all pixels of the image between mouse down and up
inclusive as points in an RGBA color space.
(4) Now treat it as a problem in spatial geometry.
and find a least squares solution with respect to some
degree 2 bezier spline basis (some thought required as to
finding optimal nonuniform knot spacing to capture large
deltas nicely - See [1] for background)
(5) The control points found in color space map to the
color section markings in the gradient editor. The
join points of adjacent degree two splines are black
section markers; the interior control points are white
markers.
(6) From the user's prospect, this is a gradient snapshot
tool: see a nice gradient in an image? Swipe a line over
it and then name it. Bring up the gradient editor to tweak.
(7) From the programmer's perspective, its a GtkObject that
embeds L.S. logic to wean way-over-determined datasets
into something more managable. The same logic can turn
pen strokes into spline vectors or data reduce tablet
output into sparse events, which, methinks, would help
most pen-like Gimp tools deal with tablet data (#5947
lead to this thought).
All this is very much post 1.2 thinking. Back to bug fixing.
Be good, be well
Garry Osgood
[1] Press, William H. et alia. "Numerical Recipes in C" 2nd Ed.
(1992) Section 15.4 "General Linear Least Squares"