AKTIVE

Documentation
Login

Documentation

Project ↗ Documentation ↗ Tutorials ↗ How To's ↗ Explanations ↗ References
Entry ↗ Sections ↘ Permuted Sections ↘ Names ↘ Permuted Names ↘ Strict ↘ Implementations ↘

Documentation -- Reference Pages -- generator virtual warp

Table Of Contents

Operators

Operators


aktive transform affine

Syntax: aktive transform affine (param value)... [→ definition]

Returns a single-band 3x3 image holding the affine transformation specifed by the 6 parameters a to f.

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
a double Parameter a of the affine transform
b double Parameter b of the affine transform
c double Parameter c of the affine transform
d double Parameter d of the affine transform
e double Parameter e of the affine transform
f double Parameter f of the affine transform

Examples

aktive transform affine a 1 b 2 c 3 d 4 e 5 f 6
 
123
456
001


aktive transform compose

Syntax: aktive transform compose srcs... [→ definition]

Takes any number of 3x3 projective transformation matrices and returns their composition.

The result is suitable for use with aktive warp matrix

A single matrix is passed through unchanged. And not materialized either.

This operator is strict in all inputs. All projective matrices are materialized and immediately used to compute the composition.

Input Description
args... Source images

Examples

@1
(translate x -5 y -6)
@2
(rotate by 45)
@3
(translate x 5 y 6)
aktive transform compose @1 @2 @3
(rotate 45 around (5,6))
1.00000.0000-5.0000
0.00001.0000-6.0000
0.00000.00001.0000
0.7071-0.70710.0000
0.70710.70710.0000
0.00000.00001.0000
1.00000.00005.0000
0.00001.00006.0000
0.00000.00001.0000
0.7071-0.7071-5.7071
0.70710.70711.7782
0.00000.00001.0000


aktive transform compose-core

Syntax: aktive transform compose-core src0 src1 [→ definition]

Takes two 3x3 projective transformation matrices and returns their composition.

The result is suitable for use with aktive warp matrix

This operator is strict in both inputs. The two projective matrices are materialized and immediately used to compute the composition A*B.

Input Description
src0
src1

Examples

@1
(rotate)
@2
(translate)
aktive transform compose-core @1 @2
(rotate after translate)
0.7071-0.70710.0000
0.70710.70710.0000
0.00000.00001.0000
1.00000.00005.0000
0.00001.00006.0000
0.00000.00001.0000
0.7071-0.7071-0.7071
0.70710.70717.7782
0.00000.00001.0000

@1
(rotate)
@2
(translate)
aktive transform compose-core @1 @2
(translate after rotate)
1.00000.00005.0000
0.00001.00006.0000
0.00000.00001.0000
0.7071-0.70710.0000
0.70710.70710.0000
0.00000.00001.0000
0.7071-0.70715.0000
0.70710.70716.0000
0.00000.00001.0000


aktive transform domain

Syntax: aktive transform domain src0 src1 [→ definition]

Returns the domain generated by applying the transformation (src0) to the domain of the image (src1). The domain is returned in the same form at as generated by aktive query domain, i.e. a 4-element Tcl list in the format {x y w h}.

Fractions are rounded to integers such that the actual domain is kept enclosed.

This operator is strict in the 1st input. The projective matrix is materialized for the calculation of the domain.

Input Description
src0
src1

Examples

@1
 
@2
(rotate by 30)
aktive transform domain @2 @1
 
@1
geometry(0 0 380 250 3)
0.8660-0.50000.0000
0.50000.86600.0000
0.00000.00001.0000
 -124 0 454 407


aktive transform identity

Syntax: aktive transform identity [→ definition]

Returns a single-band 3x3 image containing the identity transform.

The result is suitable for use with aktive warp matrix

Examples

aktive transform identity
 
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform invert

Syntax: aktive transform invert src [→ definition]

Takes a single 3x3 projective transformation matrix and returns the matrix of the inverted transformation. This is used to turn forward into backward transformations, and vice versa.

The result is suitable for use with aktive warp matrix

This operator is strict in the 1st input. The projective matrix is materialized and immediately used to compute the inversion.

Input Description
src Source image

Examples

@1
(translate x -5 y -6)
aktive transform invert @1
 
1.00000.0000-5.0000
0.00001.0000-6.0000
0.00000.00001.0000
1.0000-0.00005.0000
-0.00001.00006.0000
0.0000-0.00001.0000

@1
(translate x -5 y -6)
@2
(invert)
aktive transform compose @1 @2
 
1.00000.0000-5.0000
0.00001.0000-6.0000
0.00000.00001.0000
1.0000-0.00005.0000
-0.00001.00006.0000
0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform point

Syntax: aktive transform point src (param value)... [→ definition]

Returns the point generated by the application of the transformation to the input point.

Input Description
src Source image
Parameter Type Default Description
at point Point to transform.

Examples

@1
 
@2
(at 0 0)
@3
(at 0 1)
@4
(at 1 1)
aktive transform point @1 at {1 0}
(at 1 0)
5.00001.00001.0000
-1.00005.00002.0000
-0.0000-0.00001.0000
 1.0 2.0  2.0 7.0  7.0 6.0  6.0 1.0

@1
 
@2
(at 1 2 => 0 3)
@3
(at 6 1 => 7 1)
@4
(at 7 6 => 8 7)
aktive transform point @1 at {2 7}
(at 2 7 => 1 7)
0.93770.0220-0.9817
-0.28210.92311.4359
-0.06230.02201.0183
 0.0 3.0000000000000004  7.000000000000001 1.0000000000000004  8.000000000000002 7.000000000000002  1.0000000000000004 7.000000000000002


aktive transform points

Syntax: aktive transform points src (param value)... [→ definition]

Returns the list of points generated by the application of the transformation to the input points.

Input Description
src Source image
Parameter Type Default Description
series point... Points to transform.

Examples

@1
 
aktive transform points @1 series {0 0} {0 1} {1 1} {1 0}
 
5.00001.00001.0000
-1.00005.00002.0000
-0.0000-0.00001.0000
 {1.0 2.0} {2.0 7.0} {7.0 6.0} {6.0 1.0}

@1
 
aktive transform points @1 series {1 2} {6 1} {7 6} {2 7}
 
0.93770.0220-0.9817
-0.28210.92311.4359
-0.06230.02201.0183
 {0.0 3.0000000000000004} {7.000000000000001 1.0000000000000004} {8.000000000000002 7.000000000000002} {1.0000000000000004 7.000000000000002}


aktive transform projective

Syntax: aktive transform projective (param value)... [→ definition]

Returns a single-band 3x3 image holding the projective transformation specifed by the 8 parameters a to h.

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
a double Parameter a of the projective transform
b double Parameter b of the projective transform
c double Parameter c of the projective transform
d double Parameter d of the projective transform
e double Parameter e of the projective transform
f double Parameter f of the projective transform
g double Parameter g of the projective transform
h double Parameter h of the projective transform

Examples

aktive transform projective a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8
 
123
456
781


aktive transform quad 2quad

Syntax: aktive transform quad 2quad (param value)... [→ definition]

Returns a single-band 3x3 image transforming the specified quadrilateral A to the second quadrilateral B.

The result is suitable for use with aktive warp matrix

The quadrilaterals are specified as 4 points A-B-C-D and E-F-G-H in counter clockwise order. The returned transform maps A to E and then the other points in counter clockwise order.

It is implemented by chaining a regular and an inverted aktive transform quad unit2 to transform A-B-C-D to a unit square and from there then to E-F-G-H.

Parameter Type Default Description
a point Point A of the quadrilateral A
b point Point B of the quadrilateral A
c point Point C of the quadrilateral A
d point Point D of the quadrilateral A
e point Point A of the quadrilateral B
f point Point B of the quadrilateral B
g point Point C of the quadrilateral B
h point Point D of the quadrilateral B

Examples

aktive transform quad 2quad a {1 2} b {6 1} c {7 6} d {2 7} e {0 3} f {7 1} g {8 7} h {1 7}
 
0.93770.0220-0.9817
-0.28210.92311.4359
-0.06230.02201.0183

@1
 
@2
(invert)
aktive transform compose @1 @2
 
0.93770.0220-0.9817
-0.28210.92311.4359
-0.06230.02201.0183
1.1273-0.05451.1636
0.24551.1091-1.3273
0.0636-0.02731.0818
1.00000.0000-0.0000
-0.00001.00000.0000
0.00000.00001.0000

@1
 
@2
(at 1 2 => 0 3)
@3
(at 6 1 => 7 1)
@4
(at 7 6 => 8 7)
aktive transform point @1 at {2 7}
(at 2 7 => 1 7)
0.93770.0220-0.9817
-0.28210.92311.4359
-0.06230.02201.0183
 0.0 3.0000000000000004  7.000000000000001 1.0000000000000004  8.000000000000002 7.000000000000002  1.0000000000000004 7.000000000000002

@1
 
@2
 
@3
(at 0 3 => 1 2)
@4
(at 7 1 => 6 1)
@5
(at 8 7 => 7 6)
aktive transform point @2 at {1 7}
(at 1 7 => 2 7)
0.93770.0220-0.9817
-0.28210.92311.4359
-0.06230.02201.0183
1.1273-0.05451.1636
0.24551.1091-1.3273
0.0636-0.02731.0818
 1.0 1.9999999999999996  6.0 0.9999999999999994  6.999999999999999 5.999999999999999  1.9999999999999998 6.999999999999999

@1
(quadrilateral)
@2
( 47 62 => 0 0)
@3
(100 125 => 0 100)
@4
(210 80 => 100 100)
aktive transform point @1 at {190 10}
(190 10 => 100 0)
0.4944-0.41592.5504
0.34400.9460-74.8181
-0.0014-0.00231.2110
 -3.1086244689504383e-15 0.0  -3.994220974639806e-15 100.00000000000001  99.99999999999999 100.00000000000001  99.99999999999999 0.0

@1
(quadrilateral)
@2
(inverted)
@3
( 0 0 => 47 62)
@4
( 0 100 => 100 125)
@5
(100 100 => 210 80)
aktive transform point @2 at {100 0}
(100 0 => 190 10)
0.4944-0.41592.5504
0.34400.9460-74.8181
-0.0014-0.00231.2110
1.58800.814947.0000
-0.51170.986162.0000
0.00080.00281.0000
 47.00000000000001 61.99999999999999  100.0 125.0  210.00000000000003 80.0  190.0 10.0


aktive transform quad unit2

Syntax: aktive transform quad unit2 (param value)... [→ definition]

Returns a single-band 3x3 image transforming the unit square to the specified quadrilateral.

The result is suitable for use with aktive warp matrix

The quadrilateral is specified as 4 points A-B-C-D in counter clockwise order. The returned transform maps the origin of the unit square to A and then the other points in counter clockwise order.

To map between two arbitrary quadrilaterals A and B a composition of two transforms is necessary and sufficient, i.e. mapping A to the unit square (as inversion of the map from unit square to A), followed by mapping the unit square to B. This is what aktive transform quad 2quad does.

Parameter Type Default Description
a point Point A of the quadrilateral
b point Point B of the quadrilateral
c point Point C of the quadrilateral
d point Point D of the quadrilateral

Examples

aktive transform quad unit2 a {1 2} b {6 1} c {7 6} d {2 7}
 
5.00001.00001.0000
-1.00005.00002.0000
-0.0000-0.00001.0000

@1
 
@2
(at 0 0)
@3
(at 0 1)
@4
(at 1 1)
aktive transform point @1 at {1 0}
(at 1 0)
5.00001.00001.0000
-1.00005.00002.0000
-0.0000-0.00001.0000
 1.0 2.0  2.0 7.0  7.0 6.0  6.0 1.0

@1
 
@2
(invert)
aktive transform compose @1 @2
 
5.00001.00001.0000
-1.00005.00002.0000
-0.0000-0.00001.0000
0.1923-0.0385-0.1154
0.03850.1923-0.4231
0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000

References


aktive transform reflect line

Syntax: aktive transform reflect line ?(param value)...? [→ definition]

Returns a single-band 3x3 image specifying a reflection along either the line through point A and the origin, or the line through points A and B.

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
a point Point A of the line to reflect over
b point {} Point B of the line to reflect over. If not specified, the origin is used

Examples

aktive transform reflect line a {5 3}
 
0.47060.88240.0000
0.8824-0.47060.0000
0.00000.00001.0000

@1
(reflect line 0--A)
@2
(invert)
aktive transform compose @1 @2
 
0.47060.88240.0000
0.8824-0.47060.0000
0.00000.00001.0000
0.47060.8824-0.0000
0.8824-0.47060.0000
-0.00000.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000

aktive transform reflect line a {5 3} b {-2 -2}
 
0.32430.94590.5405
0.9459-0.3243-0.7568
0.00000.00001.0000

@1
(reflect line A--B)
@2
(invert)
aktive transform compose @1 @2
 
0.32430.94590.5405
0.9459-0.3243-0.7568
0.00000.00001.0000
0.32430.94590.5405
0.9459-0.3243-0.7568
-0.00000.00001.0000
1.0000-0.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform reflect x

Syntax: aktive transform reflect x [→ definition]

Returns a single-band 3x3 image specifying a reflection along the x-axis.

The result is suitable for use with aktive warp matrix

When not used as part of a chain of transformations then this is better done using aktive op flip x

Examples

aktive transform reflect x
 
-1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000

@1
(reflect x)
@2
(invert)
aktive transform compose @1 @2
 
-1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000
-1.00000.0000-0.0000
0.00001.0000-0.0000
-0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform reflect y

Syntax: aktive transform reflect y [→ definition]

Returns a single-band 3x3 image specifying a reflection along the y-axis.

The result is suitable for use with aktive warp matrix

When not used as part of a chain of transformations then this is better done using aktive op flip y

Examples

aktive transform reflect y
 
1.00000.00000.0000
0.0000-1.00000.0000
0.00000.00001.0000

@1
(reflect y)
@2
(invert)
aktive transform compose @1 @2
 
1.00000.00000.0000
0.0000-1.00000.0000
0.00000.00001.0000
1.00000.0000-0.0000
0.0000-1.00000.0000
-0.00000.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform rotate

Syntax: aktive transform rotate ?(param value)...? [→ definition]

Returns a single-band 3x3 image specifying a rotation around the coordinate origin, by the given angle (in degrees).

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
by double In degrees, angle to rotate
around point {} Rotation center. Default is the origin

Examples

aktive transform rotate by 45
 
0.7071-0.70710.0000
0.70710.70710.0000
0.00000.00001.0000

@1
(rotate by 45)
@2
(invert)
aktive transform compose @1 @2
 
0.7071-0.70710.0000
0.70710.70710.0000
0.00000.00001.0000
0.70710.7071-0.0000
-0.70710.7071-0.0000
0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform scale

Syntax: aktive transform scale ?(param value)...? [→ definition]

Returns a single-band 3x3 image specifying a scaling by x- and y factors.

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
x double 1 Scaling factor for x-axis
y double 1 Scaling factor for y-axis

Examples

aktive transform scale x 3 y 0.5
 
3.00000.00000.0000
0.00000.50000.0000
0.00000.00001.0000

@1
(scale x 3 y 1/2)
@2
(invert)
aktive transform compose @1 @2
 
3.00000.00000.0000
0.00000.50000.0000
0.00000.00001.0000
0.3333-0.00000.0000
-0.00002.0000-0.0000
0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform shear

Syntax: aktive transform shear ?(param value)...? [→ definition]

Returns a single-band 3x3 image specifying a shearing along the axes. When both X and Y angles are specified the result will shear X first, then shear Y.

Beware that angles at +/- 90 degrees are poles of infinity.

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
x double 0 Angle for shearing away from the x-axis. Beware that +/- 90 degrees are poles of infinity.
y double 0 Angle for shearing away from the y-axis. Beware that +/- 90 degrees are poles of infinity.

Examples

aktive transform shear x 10
 
1.00000.17630.0000
0.00001.00000.0000
0.00000.00001.0000

aktive transform shear y 10
 
1.00000.00000.0000
0.17631.00000.0000
0.00000.00001.0000

aktive transform shear x 5 y 3
 
1.00000.08750.0000
0.05241.00460.0000
0.00000.00001.0000

@1
(shear x 5 y 3)
@2
(invert)
aktive transform compose @1 @2
 
1.00000.08750.0000
0.05241.00460.0000
0.00000.00001.0000
1.0046-0.08750.0000
-0.05241.0000-0.0000
0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive transform translate

Syntax: aktive transform translate ?(param value)...? [→ definition]

Returns a single-band 3x3 image specifying a translation by x- and y offsets.

The result is suitable for use with aktive warp matrix

Parameter Type Default Description
x double 0 Translation offset for x-axis
y double 0 Translation offset for y-axis

Examples

aktive transform translate x 3 y 1
 
1.00000.00003.0000
0.00001.00001.0000
0.00000.00001.0000

@1
(translate x 3 y 1)
@2
(invert)
aktive transform compose @1 @2
 
1.00000.00003.0000
0.00001.00001.0000
0.00000.00001.0000
1.0000-0.0000-3.0000
-0.00001.0000-1.0000
0.0000-0.00001.0000
1.00000.00000.0000
0.00001.00000.0000
0.00000.00001.0000


aktive warp 2cartesian

Syntax: aktive warp 2cartesian (param value)... [→ definition]

Returns the origin map for a transformation to cartesian from a polar around the image center.

The inverse transformation is created by aktive warp 2polar.

Inspired by http://libvips.blogspot.com/2015/11/fancy-transforms.html

The result is designed to be usable with aktive op warp bicubic and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image

Examples

aktive warp 2cartesian width 11 height 11
 
(5.5000, 5.5000)(5.0000, 5.5000)(4.5000, 5.5000)(4.0000, 5.5000)(3.5000, 5.5000)(3.0000, 5.5000)(2.5000, 5.5000)(2.0000, 5.5000)(1.5000, 5.5000)(1.0000, 5.5000)(0.5000, 5.5000)
(5.5000, 5.5000)(5.0955, 5.2061)(4.6910, 4.9122)(4.2865, 4.6183)(3.8820, 4.3244)(3.4775, 4.0305)(3.0729, 3.7366)(2.6684, 3.4428)(2.2639, 3.1489)(1.8594, 2.8550)(1.4549, 2.5611)
(5.5000, 5.5000)(5.3455, 5.0245)(5.1910, 4.5489)(5.0365, 4.0734)(4.8820, 3.5979)(4.7275, 3.1224)(4.5729, 2.6468)(4.4184, 2.1713)(4.2639, 1.6958)(4.1094, 1.2202)(3.9549, 0.7447)
(5.5000, 5.5000)(5.6545, 5.0245)(5.8090, 4.5489)(5.9635, 4.0734)(6.1180, 3.5979)(6.2725, 3.1224)(6.4271, 2.6468)(6.5816, 2.1713)(6.7361, 1.6958)(6.8906, 1.2202)(7.0451, 0.7447)
(5.5000, 5.5000)(5.9045, 5.2061)(6.3090, 4.9122)(6.7135, 4.6183)(7.1180, 4.3244)(7.5225, 4.0305)(7.9271, 3.7366)(8.3316, 3.4428)(8.7361, 3.1489)(9.1406, 2.8550)(9.5451, 2.5611)
(5.5000, 5.5000)(6.0000, 5.5000)(6.5000, 5.5000)(7.0000, 5.5000)(7.5000, 5.5000)(8.0000, 5.5000)(8.5000, 5.5000)(9.0000, 5.5000)(9.5000, 5.5000)(10.0000, 5.5000)(10.5000, 5.5000)
(5.5000, 5.5000)(5.9045, 5.7939)(6.3090, 6.0878)(6.7135, 6.3817)(7.1180, 6.6756)(7.5225, 6.9695)(7.9271, 7.2634)(8.3316, 7.5572)(8.7361, 7.8511)(9.1406, 8.1450)(9.5451, 8.4389)
(5.5000, 5.5000)(5.6545, 5.9755)(5.8090, 6.4511)(5.9635, 6.9266)(6.1180, 7.4021)(6.2725, 7.8776)(6.4271, 8.3532)(6.5816, 8.8287)(6.7361, 9.3042)(6.8906, 9.7798)(7.0451, 10.2553)
(5.5000, 5.5000)(5.3455, 5.9755)(5.1910, 6.4511)(5.0365, 6.9266)(4.8820, 7.4021)(4.7275, 7.8776)(4.5729, 8.3532)(4.4184, 8.8287)(4.2639, 9.3042)(4.1094, 9.7798)(3.9549, 10.2553)
(5.5000, 5.5000)(5.0955, 5.7939)(4.6910, 6.0878)(4.2865, 6.3817)(3.8820, 6.6756)(3.4775, 6.9695)(3.0729, 7.2634)(2.6684, 7.5572)(2.2639, 7.8511)(1.8594, 8.1450)(1.4549, 8.4389)
(5.5000, 5.5000)(5.0000, 5.5000)(4.5000, 5.5000)(4.0000, 5.5000)(3.5000, 5.5000)(3.0000, 5.5000)(2.5000, 5.5000)(2.0000, 5.5000)(1.5000, 5.5000)(1.0000, 5.5000)(0.5000, 5.5000)

References


aktive warp 2polar

Syntax: aktive warp 2polar (param value)... [→ definition]

Returns the origin map for a transformation to polar around the image center.

The inverse transformation is created by aktive warp 2cartesian.

Inspired by http://libvips.blogspot.com/2015/11/fancy-transforms.html

The result is designed to be usable with aktive op warp bicubic and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image

Examples

aktive warp 2polar width 11 height 11
 
(15.5563, 1.2500)(14.2127, 1.4086)(13.0384, 1.5980)(12.0830, 1.8210)(11.4018, 2.0762)(11.0454, 2.3557)(11.0454, 2.6443)(11.4018, 2.9238)(12.0830, 3.1790)(13.0384, 3.4020)(14.2127, 3.5914)
(14.2127, 1.0914)(12.7279, 1.2500)(11.4018, 1.4479)(10.2956, 1.6929)(9.4868, 1.9879)(9.0554, 2.3239)(9.0554, 2.6761)(9.4868, 3.0121)(10.2956, 3.3071)(11.4018, 3.5521)(12.7279, 3.7500)
(13.0384, 0.9020)(11.4018, 1.0521)(9.8995, 1.2500)(8.6023, 1.5128)(7.6158, 1.8556)(7.0711, 2.2742)(7.0711, 2.7258)(7.6158, 3.1444)(8.6023, 3.4872)(9.8995, 3.7500)(11.4018, 3.9479)
(12.0830, 0.6790)(10.2956, 0.8071)(8.6023, 0.9872)(7.0711, 1.2500)(5.8310, 1.6399)(5.0990, 2.1858)(5.0990, 2.8142)(5.8310, 3.3601)(7.0711, 3.7500)(8.6023, 4.0128)(10.2956, 4.1929)
(11.4018, 0.4238)(9.4868, 0.5121)(7.6158, 0.6444)(5.8310, 0.8601)(4.2426, 1.2500)(3.1623, 1.9879)(3.1623, 3.0121)(4.2426, 3.7500)(5.8310, 4.1399)(7.6158, 4.3556)(9.4868, 4.4879)
(11.0454, 0.1443)(9.0554, 0.1761)(7.0711, 0.2258)(5.0990, 0.3142)(3.1623, 0.5121)(1.4142, 1.2500)(1.4142, 3.7500)(3.1623, 4.4879)(5.0990, 4.6858)(7.0711, 4.7742)(9.0554, 4.8239)
(11.0454, 9.8557)(9.0554, 9.8239)(7.0711, 9.7742)(5.0990, 9.6858)(3.1623, 9.4879)(1.4142, 8.7500)(1.4142, 6.2500)(3.1623, 5.5121)(5.0990, 5.3142)(7.0711, 5.2258)(9.0554, 5.1761)
(11.4018, 9.5762)(9.4868, 9.4879)(7.6158, 9.3556)(5.8310, 9.1399)(4.2426, 8.7500)(3.1623, 8.0121)(3.1623, 6.9879)(4.2426, 6.2500)(5.8310, 5.8601)(7.6158, 5.6444)(9.4868, 5.5121)
(12.0830, 9.3210)(10.2956, 9.1929)(8.6023, 9.0128)(7.0711, 8.7500)(5.8310, 8.3601)(5.0990, 7.8142)(5.0990, 7.1858)(5.8310, 6.6399)(7.0711, 6.2500)(8.6023, 5.9872)(10.2956, 5.8071)
(13.0384, 9.0980)(11.4018, 8.9479)(9.8995, 8.7500)(8.6023, 8.4872)(7.6158, 8.1444)(7.0711, 7.7258)(7.0711, 7.2742)(7.6158, 6.8556)(8.6023, 6.5128)(9.8995, 6.2500)(11.4018, 6.0521)
(14.2127, 8.9086)(12.7279, 8.7500)(11.4018, 8.5521)(10.2956, 8.3071)(9.4868, 8.0121)(9.0554, 7.6761)(9.0554, 7.3239)(9.4868, 6.9879)(10.2956, 6.6929)(11.4018, 6.4479)(12.7279, 6.2500)

References


aktive warp matrix

Syntax: aktive warp matrix transform ?(param value)...? [→ definition]

Returns the origin map for the projective transformation specified by the 3x3x1 matrix (src) applied to an image of the given geometry and location.

Attention. As a origin map declares origin positions for output pixels the matrix has to specify a backward transformation.

The operations aktive transform affine, aktive transform identity, aktive transform projective, aktive transform quad 2quad, aktive transform quad unit2, aktive transform reflect line, aktive transform reflect x, aktive transform reflect y, aktive transform rotate, aktive transform scale, aktive transform shear, and aktive transform translate all create matrices suitable as input to this operation.

The operations aktive transform compose and aktive transform invert enable the composition of arbitrary transformations from simpler pieces, and the conversion between forward and backward transformations.

The result is designed to be usable with the aktive op warp bicubic operation and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

This operator is strict in the 1st input. The projective matrix is materialized and cached.

Input Description
transform Matrix of an affine transform.
Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image
x int 0 X location of the returned image in the 2D plane
y int 0 Y location of the returned image in the 2D plane

Examples

@1
(translate x 5 y 3)
aktive warp matrix @1 width 5 height 5
 
1.00000.00005.0000
0.00001.00003.0000
0.00000.00001.0000
(5.0000, 3.0000)(6.0000, 3.0000)(7.0000, 3.0000)(8.0000, 3.0000)(9.0000, 3.0000)
(5.0000, 4.0000)(6.0000, 4.0000)(7.0000, 4.0000)(8.0000, 4.0000)(9.0000, 4.0000)
(5.0000, 5.0000)(6.0000, 5.0000)(7.0000, 5.0000)(8.0000, 5.0000)(9.0000, 5.0000)
(5.0000, 6.0000)(6.0000, 6.0000)(7.0000, 6.0000)(8.0000, 6.0000)(9.0000, 6.0000)
(5.0000, 7.0000)(6.0000, 7.0000)(7.0000, 7.0000)(8.0000, 7.0000)(9.0000, 7.0000)

@1
(shear x 5)
aktive warp matrix @1 width 5 height 5
 
1.00000.08750.0000
0.00001.00000.0000
0.00000.00001.0000
(0.0000, 0.0000)(1.0000, 0.0000)(2.0000, 0.0000)(3.0000, 0.0000)(4.0000, 0.0000)
(0.0875, 1.0000)(1.0875, 1.0000)(2.0875, 1.0000)(3.0875, 1.0000)(4.0875, 1.0000)
(0.1750, 2.0000)(1.1750, 2.0000)(2.1750, 2.0000)(3.1750, 2.0000)(4.1750, 2.0000)
(0.2625, 3.0000)(1.2625, 3.0000)(2.2625, 3.0000)(3.2625, 3.0000)(4.2625, 3.0000)
(0.3500, 4.0000)(1.3500, 4.0000)(2.3500, 4.0000)(3.3500, 4.0000)(4.3500, 4.0000)


aktive warp noise gauss

Syntax: aktive warp noise gauss ?(param value)...? [→ definition]

Returns a origin map derived from the identity map by application of gaussian noise as displacement values.

The result is designed to be usable with the aktive op warp bicubic operation and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image
x int 0 X location of the returned image in the 2D plane
y int 0 Y location of the returned image in the 2D plane
seed uint [expr {int(4294967296*rand())}] Randomizer seed. Needed only to force fixed results.
mean double 0 Mean of the desired gauss distribution.
sigma double 1 Sigma of the desired gauss distribution.

Examples

aktive warp noise gauss width 5 height 5 seed 703011174
 
(-2.0121, 1.5892)(1.3499, 0.2499)(2.7147, -0.1152)(3.8782, -1.6135)(5.1449, 0.2902)
(-0.6889, 2.2202)(2.3416, -0.5845)(1.2220, -0.3694)(3.6195, 0.7493)(4.7044, 0.2976)
(0.0954, 2.3508)(-1.0648, 0.3407)(1.7567, 1.7429)(4.3928, 0.8721)(3.1299, 2.1653)
(-0.1816, 2.7917)(0.6991, 4.0203)(3.5031, 2.0773)(2.9707, 1.2286)(2.6036, 4.7599)
(-1.3935, 4.7155)(-0.9779, 3.3744)(2.9045, 3.9337)(5.0461, 5.1393)(5.4505, 3.5626)


aktive warp noise uniform

Syntax: aktive warp noise uniform ?(param value)...? [→ definition]

Returns a origin map derived from the identity map by application of uniform noise as displacement values

The result is designed to be usable with the aktive op warp bicubic operation and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image
x int 0 X location of the returned image in the 2D plane
y int 0 Y location of the returned image in the 2D plane
seed uint [expr {int(4294967296*rand())}] Randomizer seed. Needed only to force fixed results.
min double 0 Minimal noise value
max double 1 Maximal noise value

Examples

aktive warp noise uniform width 5 height 5 seed 703011174
 
(0.8863, 0.8719)(1.7793, 0.2554)(2.4107, 0.5807)(3.9289, 0.7495)(4.3616, 0.7607)
(0.3324, 1.3431)(1.1898, 1.9291)(2.6310, 1.1222)(3.3401, 1.4667)(4.3098, 1.1832)
(0.5581, 2.0059)(1.9649, 2.9972)(2.6588, 2.9941)(3.4623, 2.0973)(4.0229, 2.5306)
(0.5197, 3.8011)(1.9559, 3.6307)(2.3224, 3.6220)(3.8149, 3.1401)(4.2486, 3.3354)
(0.5329, 4.0316)(1.1691, 4.5186)(2.8783, 4.5382)(3.5672, 4.7050)(4.2872, 4.0349)


aktive warp swirl

Syntax: aktive warp swirl ?(param value)...? [→ definition]

Returns the origin map for a swirl effect around the specified center, with fixed rotation phi, a base rotation from, and a decay factor.

The rotation angle added to a pixel is given by phi + from * exp(-radius * decay), where radius is the distance of the pixel from the center. A large decay reduces the swirl at shorter radii. A decay of zero disables the decay.

All parameters except for the center are optional.

The result is designed to be usable with the aktive op warp bicubic operation and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image
x int 0 X location of the returned image in the 2D plane
y int 0 Y location of the returned image in the 2D plane
center point Center of the swirl
phi double 0 In degrees, fixed rotation to apply.
from double 45 In degrees, swirl rotation at distance 0 from center.
decay double 0.1 Rotation decay with distance from center.

Examples

aktive warp swirl width 11 height 11 center {5 5} decay 1
 
(0.0033, -0.0033)(1.0065, -0.0052)(2.0115, -0.0069)(3.0180, -0.0072)(4.0240, -0.0047)(5.0265, 0.0001)(6.0240, 0.0049)(7.0180, 0.0072)(8.0115, 0.0069)(9.0065, 0.0052)(10.0033, 0.0033)
(0.0052, 0.9935)(1.0110, 0.9890)(2.0212, 0.9842)(3.0360, 0.9822)(4.0510, 0.9876)(5.0575, 1.0004)(6.0508, 1.0130)(7.0358, 1.0181)(8.0211, 1.0159)(9.0110, 1.0110)(10.0052, 1.0065)
(0.0069, 1.9885)(1.0159, 1.9789)(2.0340, 1.9663)(3.0645, 1.9580)(4.1003, 1.9684)(5.1173, 2.0023)(6.0992, 2.0349)(7.0636, 2.0434)(8.0337, 2.0340)(9.0158, 2.0212)(10.0069, 2.0115)
(0.0072, 2.9820)(1.0181, 2.9642)(2.0434, 2.9364)(3.0950, 2.9093)(4.1712, 2.9232)(5.2122, 3.0113)(6.1642, 3.0909)(7.0907, 3.0950)(8.0420, 3.0645)(9.0178, 3.0360)(10.0072, 3.0180)
(0.0049, 3.9760)(1.0130, 3.9492)(2.0349, 3.9008)(3.0909, 3.8358)(4.2080, 3.8284)(5.2849, 4.0415)(6.1716, 4.2080)(7.0768, 4.1712)(8.0316, 4.1003)(9.0124, 4.0510)(10.0047, 4.0240)
(0.0001, 4.9735)(1.0004, 4.9425)(2.0023, 4.8827)(3.0113, 4.7878)(4.0415, 4.7151)(5.0000, 5.0000)(5.9585, 5.2849)(6.9887, 5.2122)(7.9977, 5.1173)(8.9996, 5.0575)(9.9999, 5.0265)
(-0.0047, 5.9760)(0.9876, 5.9490)(1.9684, 5.8997)(2.9232, 5.8288)(3.8284, 5.7920)(4.7151, 5.9585)(5.7920, 6.1716)(6.9091, 6.1642)(7.9651, 6.0992)(8.9870, 6.0508)(9.9951, 6.0240)
(-0.0072, 6.9820)(0.9822, 6.9640)(1.9580, 6.9355)(2.9093, 6.9050)(3.8358, 6.9091)(4.7878, 6.9887)(5.8288, 7.0768)(6.9050, 7.0907)(7.9566, 7.0636)(8.9819, 7.0358)(9.9928, 7.0180)
(-0.0069, 7.9885)(0.9842, 7.9788)(1.9663, 7.9660)(2.9364, 7.9566)(3.9008, 7.9651)(4.8827, 7.9977)(5.8997, 8.0316)(6.9355, 8.0420)(7.9660, 8.0337)(8.9841, 8.0211)(9.9931, 8.0115)
(-0.0052, 8.9935)(0.9890, 8.9890)(1.9789, 8.9841)(2.9642, 8.9819)(3.9492, 8.9870)(4.9425, 8.9996)(5.9490, 9.0124)(6.9640, 9.0178)(7.9788, 9.0158)(8.9890, 9.0110)(9.9948, 9.0065)
(-0.0033, 9.9967)(0.9935, 9.9948)(1.9885, 9.9931)(2.9820, 9.9928)(3.9760, 9.9951)(4.9735, 9.9999)(5.9760, 10.0047)(6.9820, 10.0072)(7.9885, 10.0069)(8.9935, 10.0052)(9.9967, 10.0033)

References


aktive warp wobble

Syntax: aktive warp wobble ?(param value)...? [→ definition]

Returns the origin map for a wobble effect around the specified center, with base amplitude, frequency, chirp, and attenuation powers.

Inspired by http://libvips.blogspot.com/2015/11/fancy-transforms.html

The result is designed to be usable with the aktive op warp bicubic operation and its relatives.

At the technical level the result is a 2-band image where each pixel declares its origin position.

The effect modulates the distance from the center based on the formula sin (radius^chirp * frequency) * amplitude / (1+radius)^attenuation, where radius is the original distance.

All parameters, including the center are optional.

Parameter Type Default Description
width uint Width of the returned image
height uint Height of the returned image
center point {} Center of the wobble, relative to the origin. Defaults to the image center.
amplitude double 500 Base amplitude of the displacement.
frequency double 2 Base wave frequency.
chirp double 0.5 Chirp (power) factor modulating the frequency.
attenuation double 0.6 Power factor tweaking the base 1/x attenuation.

Examples

aktive warp wobble width 11 height 11
 
(62.2541, 62.2541)(74.4622, 89.7871)(75.8743, 116.0881)(65.8213, 138.2069)(45.9354, 153.7630)(19.6927, 161.6197)(-8.6927, 161.6197)(-34.9354, 153.7630)(-54.8213, 138.2069)(-64.8743, 116.0881)(-63.4622, 89.7871)
(89.7871, 74.4622)(101.8444, 101.8444)(99.8492, 126.8061)(83.4264, 145.7675)(55.9114, 156.7343)(22.7654, 160.8884)(-11.7654, 160.8884)(-44.9114, 156.7343)(-72.4264, 145.7675)(-88.8492, 126.8061)(-90.8444, 101.8444)
(116.0881, 75.8743)(126.8061, 99.8492)(119.1076, 119.1076)(93.2554, 128.3576)(56.9551, 125.5619)(21.5618, 117.9327)(-10.5618, 117.9327)(-45.9551, 125.5619)(-82.2554, 128.3576)(-108.1076, 119.1076)(-115.8061, 99.8492)
(138.2069, 65.8213)(145.7675, 83.4264)(128.3576, 93.2554)(85.8090, 85.8090)(34.6192, 54.0320)(7.3762, 14.8811)(3.6238, 14.8811)(-23.6192, 54.0320)(-74.8090, 85.8090)(-117.3576, 93.2554)(-134.7675, 83.4264)
(153.7630, 45.9354)(156.7343, 55.9114)(125.5619, 56.9551)(54.0320, 34.6192)(-36.4779, -36.4779)(-47.4987, -153.4960)(58.4987, -153.4960)(47.4779, -36.4779)(-43.0320, 34.6192)(-114.5619, 56.9551)(-145.7343, 55.9114)
(161.6197, 19.6927)(160.8884, 22.7654)(117.9327, 21.5618)(14.8811, 7.3762)(-153.4960, -47.4987)(-249.9281, -249.9281)(260.9281, -249.9281)(164.4960, -47.4987)(-3.8811, 7.3762)(-106.9327, 21.5618)(-149.8884, 22.7654)
(161.6197, -8.6927)(160.8884, -11.7654)(117.9327, -10.5618)(14.8811, 3.6238)(-153.4960, 58.4987)(-249.9281, 260.9281)(260.9281, 260.9281)(164.4960, 58.4987)(-3.8811, 3.6238)(-106.9327, -10.5618)(-149.8884, -11.7654)
(153.7630, -34.9354)(156.7343, -44.9114)(125.5619, -45.9551)(54.0320, -23.6192)(-36.4779, 47.4779)(-47.4987, 164.4960)(58.4987, 164.4960)(47.4779, 47.4779)(-43.0320, -23.6192)(-114.5619, -45.9551)(-145.7343, -44.9114)
(138.2069, -54.8213)(145.7675, -72.4264)(128.3576, -82.2554)(85.8090, -74.8090)(34.6192, -43.0320)(7.3762, -3.8811)(3.6238, -3.8811)(-23.6192, -43.0320)(-74.8090, -74.8090)(-117.3576, -82.2554)(-134.7675, -72.4264)
(116.0881, -64.8743)(126.8061, -88.8492)(119.1076, -108.1076)(93.2554, -117.3576)(56.9551, -114.5619)(21.5618, -106.9327)(-10.5618, -106.9327)(-45.9551, -114.5619)(-82.2554, -117.3576)(-108.1076, -108.1076)(-115.8061, -88.8492)
(89.7871, -63.4622)(101.8444, -90.8444)(99.8492, -115.8061)(83.4264, -134.7675)(55.9114, -145.7343)(22.7654, -149.8884)(-11.7654, -149.8884)(-44.9114, -145.7343)(-72.4264, -134.7675)(-88.8492, -115.8061)(-90.8444, -90.8444)

References