pixmorph [-w _width_] [-n _height_] _picA.pix_ _picB.pix_ _linesfile_ _warpfrac_ _dissolvefrac_ > _out.pix_
PIXMORPH(1)
NAME
pixmorph - feature-based morph between two pix(5) images
On this page
SYNOPSIS
DESCRIPTION
pixmorph performs feature-based image metamorphosis between two pix(5) images, picA.pix and picB.pix, writing the resulting image to standard output. The two images must have the same dimensions; the size is taken from picA.pix automatically unless overridden with -w and/or -n.
The morph is controlled by linesfile, which holds pairs of directed line segments that match corresponding features in the two images (for example, a segment along the nose in picA.pix paired with the corresponding segment in picB.pix). Such a file can be produced with a utility such as morphedit.tcl.
Two scalars in the range [0, 1] drive the result. warpfrac controls how far the features of each image are warped toward the other; dissolvefrac controls how much cross-dissolve is blended between the two warped images. Typically the user sets warpfrac = dissolvefrac, and produces a morph animation as a sequence of frames with steadily increasing values.
The linesfile begins with header constants a, b, p, and the line count n, followed by n segment pairs (each segment is four reals in unit-square coordinates). The constants weight each segment’s influence by length p) / (a + dist b; in practice a = 0.1, b = 2.0, p = 0.2 work well. For a full description of the algorithm see T. Beier and S. Neely, "Feature-Based Image Metamorphosis", SIGGRAPH 1992 Computer Graphics Proceedings (volume 26 number 2), pp 35-42.
OPTIONS
- -w width
-
Set the width, in pixels, of the input images. Disables autosizing.
- -n height
-
Set the height, in pixels, of the input images. Disables autosizing.
EXAMPLES
for i in 0 1 2 3 4 5; do
f=$(echo "$i / 5" | bc -l)
pixmorph face1.pix face2.pix lines.txt $f $f > frame$i.pix
done
Produces a sequence of frames morphing face1.pix into face2.pix. Because warpfrac = dissolvefrac runs from 0.0 to 1.0, frame0.pix equals face1.pix and frame5.pix equals face2.pix, with the intermediate frames blending feature warp and cross-dissolve together.
pixmorph face1.pix face2.pix lines.txt 0.5 0.0 > out.pix
With dissolvefrac = 0 the contribution of face2.pix is ignored at the dissolve stage, so out.pix consists entirely of face1.pix warped 50% toward face2.pix according to lines.txt. Conversely, setting warpfrac = 0 yields a plain 50% cross-dissolve with no warping.
SEE ALSO
brlcad(1), pixblend(1), pix(5)
AUTHOR
BRL-CAD Team
COPYRIGHT
This software is Copyright (c) 1996-2026 by the United States Government as represented by U.S. Army Research Laboratory.
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org