fmw42 wrote:I believe that he is developing the following methods: barycentric, bilinear, shepards and voronoi.
One will be able to specify a few random or well-placed points of color and the sparse-color option will "interpolate" the colors to fill out the image according to one of those methods.
-sparse-color is still in development, but is working.
Basically as of the last few release you can specify
Code: Select all
convert {some image} \
-sparse-color {method} 'x,y color x,y color x,y color ...' \
{output processing and saving}
It will try to set the color given at each of the floating point coordinates, and then map the rest of the image to try and best fit those colors.
- voronoi map to nearest color point
- shepards use a inverse square (like gravity wells) spreading out to an average of the colors at infinity
- barycentric three point triangle of color forming a linear gradients in each channel. Essentually a 3 color affine linear equation fit to three points. If two points are given a thrid is generated to form a simple linear gradiant between the two points (diagonal gradients!).
- bilinear try to bestfit a 4 point bilinear equation to the points (not a great result and may be deleted from the final method list).
All this is not final, and even the options may not remain in the 'x,y color' form, though I will try to keep it that way.
Ideas and other types coloring methods based on sparsely separated points will also be welcome.
For example I am considering allowing the use of '%' escapes in arguments (ditto for -distort).
Also a '+' form of
+sparse-color will take just a simple list of coordinates (no colors) and read the colors from the given image at those points. That will allow you to 'recreate' backgrounds that exists under text and foreground objects to allow better background removal!
I am also planing a 'delaney triangular mesh' set of algorithms, with barycentric fill or triangular spline fill. But it takes time.
NOTHING however is settled! Ideas are welcome.
PS: I am also considering another option
-mark-points which will draw symbols (See
Drawing Symbols as a List of Points that was recently added) and the triangulation between the points. Though this may in fact be added to the
-draw MVG language instead of a new option. This will help users mark out images in various ways, letting you mark and check various reference points for distortions and drawing methods.
Too much to do, not enough time to do it.
I have Barrel Distortion documentation to complete, and other Distortions to add. That includes distortions based on a 'delaney triangular mesh' which will give IM a great boost toward the ability to do spatial morphs. That is morphs similar to what Fred Weinhaus was able to generate using a simple (single point move) form of the
'Shepards' Distortion, See his "
shapemorph" script.
I am also considering how to add a Perlin Noise Generator (in a tileable 'time referencing' method.
As well as improvements to the Plasma Fractal Generator, which internally accepts a image to modify (like a
gradient: image in the current
plasma: operator)