PIXMORPH(1)
π PIXMORPH(1) β like, the manual page, but make it make sense β¨
okay bestie, buckle up, because this is pixmorph from the BRL-CAD fam, and honestly? she's iconic. this is the page for doing a feature-based morph between two pix(5) images β yes, the full "turn my face into your face" situation. no cap. π¦
πΈ SYNOPSIS πΈ
pixmorph [-w _width_] [-n _height_] _picA.pix_ _picB.pix_ _linesfile_ _warpfrac_ _dissolvefrac_ > _out.pix_
that's the whole vibe. the morph goes to standard output, so don't forget your > redirect, babes. π
π₯ DESCRIPTION π₯
so pixmorph performs a feature-based image metamorphosis between two pix(5) images β picA.pix and picB.pix β and writes the resulting image to standard output. literally the main character of image morphing.
the two images must have the same dimensions. the size is taken from picA.pix automatically, unless you override it with -w and/or -n. slay, autosizing. β¨
the morph is controlled by linesfile, which holds pairs of directed line segments that match corresponding features in the two images. think: a segment along the nose in picA.pix, paired with the corresponding segment in picB.pix. yes, you're literally drawing lines on a face. it's giving arts and crafts but make it computational. π
ngl, you don't hand-write that file. such a file can be produced with a utility such as morphedit.tcl. iykyk.
two scalars in the range [0, 1] drive the whole thing:
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. periodt. that's the whole recipe.
π§ the linesfile format, bestie
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. don't ask me to draw it, just know it's four reals per segment. π
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. copy that, it's free. π
for a full description of the algorithm see:
- 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 π
Example 1. Generate a six-frame morph animation
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. like, the glow-up is chronological. ππ₯
Example 2. Warp without cross-dissolving
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. two settings, two completely different vibes. π«
π SEE ALSO π
brlcad(1), pixblend(1), pix(5)
go read those next, bestie, it's a whole ecosystem. πΈ
π AUTHOR π
BRL-CAD Team β the group chat admins of this whole thing. π
β COPYRIGHT β
this software is Copyright (c) 1996-2026 by the United States Government as represented by U.S. Army Research Laboratory. yes, 1996-2026, that's a long-running streak and honestly? respect. π«Ά
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. don't be shy, they literally want to know. not me being the bug reporter bestie. π
so yeah, that's pixmorph β feature-based morphing between two pix(5) images, from BRL-CAD, documented in this very PIXMORPH(1) page. see you in the group chat, mwah π
β¨π
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms