Distort big images with low memory needs.
A libvips reimplementation of ImageMagick's multi-points distortion method: shepard's algorithm (source code).
python3 light-distortion.py <INPUT_FILE> <OUTPUT_FILE> <POINTS>
Example:
python3 light-distortion.py koala.gif output.gif "30,11 20,11 48,29 58,29"
input | output |
---|---|
![]() |
![]() |
Corresponding ImageMagick command:
convert koala.gif -distort Shepards '30,11 20,11 48,29 58,29' output.gif
Tested image: png of 129 MB and 5 random distortion couples
ImageMagick | Pyvips (light-distortion) | |
---|---|---|
peak memory | 4058 MB | 160 MB |
time | 64 seconds | 41 seconds |