warp_region
Warps or liquefies image regions by pushing pixels along specified vectors, enabling controlled edits such as turning a neutral mouth into a smile.
Instructions
Warp / liquify a region of the image by pushing pixels in a direction.
Uses GEGL warp (GIMP 3 native) with plug-in-iwarp fallback. Ideal for subtle facial expression edits — e.g. turning a neutral mouth into a smile by pushing the mouth corners upward.
Parameters:
vectors: List of warp stroke dicts, each with:
x, y : center of the warp influence (pixels)
dx, dy : push direction — negative dy = push upward
radius : influence radius in pixels (default: 40)
amount : deform strength 0–1 (default: 0.3)
image_index: Which open image to edit (default: 0)
layer_name: Target layer; omit to use the active/top layer
Examples — make a character smile: warp_region(vectors=[ {"x": 215, "y": 355, "dx": 5, "dy": -8, "radius": 18, "amount": 0.45}, {"x": 295, "y": 355, "dx": -5, "dy": -8, "radius": 18, "amount": 0.45}, {"x": 255, "y": 370, "dx": 0, "dy": -4, "radius": 22, "amount": 0.30}, ])
Returns: {"warped_vectors": N}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vectors | Yes | ||
| layer_name | No | ||
| image_index | No |