Skip to content

abeliansoup/conformap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conformal Mapper

WARNING: This is a purely vibe-coded repo. It is subsloptimal. I make no guarantees about anything; use at your own peril. The standard caveats apply. If symptoms persist, etc.

What

Applies conformal (angle-preserving) mappings to images, creating a new image with those transformations applied, and (optinally) an animation of the process. (Also, technically the last two transformations are not actually conformal, but they're here now so).


Example transformation animation


Available Mappings

Starting with this input image

Example transformation animation
a sampling of transformations goes as:

Mapping Description -s 0.5 -s 1.5 -s 2.5
mobius Mobius transform mobius_05.png mobius_15.png mobius_25.png
spiral Logarithmic spiral spiral_05.png spiral_15.png spiral_25.png
joukowski Joukowski airfoil transform joukowski_05.png joukowski_15.png joukowski_25.png
exp Complex exponential exp_05.png exp_15.png exp_25.png
log Complex logarithm log_05.png log_15.png log_25.png
power Power mapping (z^n) power_05.png power_15.png power_25.png
sin Complex sine sin_05.png sin_15.png sin_25.png
inversion Circle inversion (1/z) inversion_05.png inversion_15.png inversion_25.png
swirl Swirl distortion swirl_05.png swirl_15.png swirl_25.png
droste Droste effect (recursive zoom) droste_05.png droste_15.png droste_25.png

Installation

Using uv (recommended)

uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt

Using pip

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage

Basic transformation

python conformal_map.py input.jpg -o output.png -m mobius

List available mappings

python conformal_map.py --list

Create animated GIF

python conformal_map.py input.jpg -g animation.gif -m swirl -n 60 --duration 30

Create MP4 video

python conformal_map.py input.jpg --mp4 animation.mp4 -m droste -n 60

Note: MP4 output requires ffmpeg to be installed.

Options

Option Description
-o, --output Output image path (default: output.png)
-m, --mapping Conformal mapping to apply
-s, --scale Scale factor for complex plane (default: 2.0)
-g, --gif Output GIF path for animation
--mp4 Output MP4 path for animation
-n, --frames Number of frames for animation (default: 30)
--duration Duration per frame in ms (default: 50)
-l, --list List available mappings

Running with uv (without installing)

uv run --with numpy --with pillow --with tqdm conformal_map.py input.jpg -m spiral -s 1.5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages