|
The Splitter plug-in can be used to split a picture according to a
mathematical formula into two layers, translate and/or rotate the
layers and optionally merge them back into one picture.
Latest version is 0.3 and you can download it
here (20k).
Building the plug-in is straightforward. First unpack the gzipped
tarfile:
% tar xvfz splitter-0.3.tgz
Next compile and install the plug-in with:
% make install
After installation the plug-in can be found as
"Filters/Generic/Splitter" by clicking with the right mouse button
in a picture. After doing so the next dialog will appear:
The first field is the entry labeled 'f(x,y)'. Here you can fill in
any valid mathematical expression in x and y. The standard operators
(+, -, *, /, ^, %) can be used as well as a lot of the standard C
math functions (abs, ceil, cos, exp, floor, log, log10, min, max,
mod, pow, rand, rint, sin, sqrt, tan, acos, asin, atan, atan2, sinh,
cosh, tanh, ldexp).
Four special symbols are provided:
- w (width of the image)
- h (height of the image)
- pi (usual definition of pi: 3.14159265...)
- e (2.7182818...)
The formula f(x, y) is evaluated for each point in your picture. If
the resulting value is less than zero the point is asigned to the
first layer, otherwise to the second layer.
The other fields are more obvious: 'Translate x:' and 'Translate y:'
perform a translation on the layer. 'Rotate:' does a rotation around
the center of the layer. The checkbutton 'Merge visible layers'
determines whether the seperate layers should be merged after
splitting the picture.
First example:
On the left side the original picture. The right picture was created
with:
f(x, y): h/2 - h/8 * cos(x * 8 * pi / w) - y
Layer2, Translate y: -50 Pixels
Layer2, Rotate: 10 Degrees
Merge visible layers: selected
Second example:
On the left side the original picture. The right picture was created
with:
f(x, y): (x - rint(x/15)*15)^2 + (y-rint(y/15)*15)^2 - 25
No translation or rotation
Merge visible layers: unselected
Next I selected the second layer (in the Layers & Channels dialog) and
put a black background behind it.
There are a few things still left on my todo list. In no particular
order:
- Add preview
- Port to Gimp 1.4/2.0
- Load/save formulas
|