Skip to content

Distortion script based on libvips. Replacement of ImageMagick's "-distort Shepards" command

Notifications You must be signed in to change notification settings

tourtiere/light-distortion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Light distortion

Distort big images with low memory needs.

A libvips reimplementation of ImageMagick's multi-points distortion method: shepard's algorithm (source code).

Usage

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
koala output

Corresponding ImageMagick command:

convert koala.gif -distort Shepards '30,11 20,11  48,29 58,29' output.gif

Benchmark

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

About

Distortion script based on libvips. Replacement of ImageMagick's "-distort Shepards" command

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages