Spaces:
Sleeping
Sleeping
| title: Drostescher | |
| emoji: π¨ | |
| colorFrom: pink | |
| colorTo: blue | |
| sdk: gradio | |
| sdk_version: 6.12.0 | |
| app_file: app.py | |
| pinned: false | |
| short_description: apply the Droste / logarithmic-spiral zoom effect | |
| # π Droste Effect | |
| Upload any image (works best with logos or images that have a transparent background) | |
| and apply the **Droste / logarithmic-spiral zoom** effect. | |
| ## Features | |
| | Mode | Output | | |
| |------|--------| | |
| | **Still** | Single warped frame (PNG) | | |
| | **Animation** | Seamlessly looping GIF zoom | | |
| ## Parameters | |
| - **Width / Height** β output resolution | |
| - **Frames** β number of animation frames (more = smoother, slower) | |
| - **Rotations per loop** β how many full turns the spiral completes in one loop | |
| - **FPS** β playback speed of the exported GIF | |
| ## How it works | |
| 1. Each pixel `(t, l)` is mapped to normalised Cartesian space `(y, x) β [-1,1]Β²`. | |
| 2. Polar coordinates `(r, a)` are computed, then `logr = logβ(r)`. | |
| 3. The angle modulates the log-radius: `logr -= na` (turns circles into a spiral). | |
| 4. `logr` is folded into `[-1, 0)` so the image tiles seamlessly across octaves. | |
| 5. The inverse transform reconstructs pixel addresses, with transparent pixels | |
| resolved by stepping one octave inward until opaque colour is found. | |
| The animation adds a time offset `s β [0,1)` to both `logr` and `na`, producing | |
| a perfectly looping zoom-rotation. | |
| ## Local usage | |
| ```bash | |
| pip install gradio numpy numba Pillow | |
| python app.py | |
| ``` | |