Moving least squares
Moving least squares
Pin an image in place, pull one point, and watch the surrounding shape bend through a field of local transformations.
Try it
Runs locally in your browser. Uploaded images stay on your device.
Drag a pin to deform the image. Double-click to add one. The selected pin also has keyboard-accessible position controls.


Ready when you are.
Worker processing · local inputs · downloadable output
How it works
Drag a pin to deform the image. Double-click to add one. The selected pin also has keyboard-accessible position controls.
- Give nearby control points more influence than distant ones.
- Solve a weighted rigid, similarity, or affine transformation separately at each mesh vertex.
- Warp a triangle mesh forward and resample its pixels, keeping control points interpolated.
Read the original research
Schaefer, McPhail & Warren · 2006
Computed examples
Outputs from the same implementation used in the playground.


Source photographs were generated for these studies. The displayed results were computed by the algorithms; they are not generated illustrations of an expected result. Published previews are compressed for the web.
Implementation and limits
The continuous deformation is approximated by a triangulated image mesh. Extreme crossed pins can fold the mesh; uncovered regions stay transparent.
Interactive settings are bounded to keep the experiment practical in a browser. Higher detail can cost more processing time without guaranteeing a better result. The implementation and its tests are available in the source repository.