fantasticfractals 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. fantasticfractals-1.0.0/LICENSE +21 -0
  2. fantasticfractals-1.0.0/PKG-INFO +289 -0
  3. fantasticfractals-1.0.0/README.md +244 -0
  4. fantasticfractals-1.0.0/pyproject.toml +73 -0
  5. fantasticfractals-1.0.0/setup.cfg +4 -0
  6. fantasticfractals-1.0.0/src/fantasticfractals/__init__.py +88 -0
  7. fantasticfractals-1.0.0/src/fantasticfractals/analysis/dimension.py +59 -0
  8. fantasticfractals-1.0.0/src/fantasticfractals/cli/main.py +181 -0
  9. fantasticfractals-1.0.0/src/fantasticfractals/core/algorithms.py +503 -0
  10. fantasticfractals-1.0.0/src/fantasticfractals/core/registry.py +344 -0
  11. fantasticfractals-1.0.0/src/fantasticfractals/engines/numpy_engine.py +67 -0
  12. fantasticfractals-1.0.0/src/fantasticfractals/exporters/image.py +75 -0
  13. fantasticfractals-1.0.0/src/fantasticfractals/exporters/video.py +128 -0
  14. fantasticfractals-1.0.0/src/fantasticfractals/palettes/colormaps.py +129 -0
  15. fantasticfractals-1.0.0/src/fantasticfractals.egg-info/PKG-INFO +289 -0
  16. fantasticfractals-1.0.0/src/fantasticfractals.egg-info/SOURCES.txt +21 -0
  17. fantasticfractals-1.0.0/src/fantasticfractals.egg-info/dependency_links.txt +1 -0
  18. fantasticfractals-1.0.0/src/fantasticfractals.egg-info/entry_points.txt +2 -0
  19. fantasticfractals-1.0.0/src/fantasticfractals.egg-info/requires.txt +19 -0
  20. fantasticfractals-1.0.0/src/fantasticfractals.egg-info/top_level.txt +1 -0
  21. fantasticfractals-1.0.0/tests/test_analysis.py +15 -0
  22. fantasticfractals-1.0.0/tests/test_registry.py +25 -0
  23. fantasticfractals-1.0.0/tests/test_render.py +29 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FantasticFractals Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,289 @@
1
+ Metadata-Version: 2.4
2
+ Name: fantasticfractals
3
+ Version: 1.0.0
4
+ Summary: High-performance mathematical fractal generator, arbitrary-precision deep zoom engine, and 4K/video exporter.
5
+ Author: FantasticFractals Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://fantasticfractals.pages.dev
8
+ Project-URL: Repository, https://github.com/QuantumTechCoder/FantasticFractals/tree/python
9
+ Project-URL: WebVersion, https://github.com/QuantumTechCoder/FantasticFractals/tree/website
10
+ Project-URL: Documentation, https://github.com/QuantumTechCoder/FantasticFractals/tree/python#readme
11
+ Project-URL: Issues, https://github.com/QuantumTechCoder/FantasticFractals/issues
12
+ Keywords: fractals,mandelbrot,julia-set,chaos-theory,mathematics,visualization,deep-zoom,generative-art,numba,numpy
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
17
+ Classifier: Topic :: Scientific/Engineering :: Visualization
18
+ Classifier: Topic :: Multimedia :: Graphics
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Environment :: Win32 (MS Windows)
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: numpy>=1.22.0
31
+ Requires-Dist: pillow>=9.0.0
32
+ Provides-Extra: accelerate
33
+ Requires-Dist: numba>=0.56.0; extra == "accelerate"
34
+ Provides-Extra: video
35
+ Requires-Dist: imageio>=2.20.0; extra == "video"
36
+ Provides-Extra: precision
37
+ Requires-Dist: mpmath>=1.2.0; extra == "precision"
38
+ Provides-Extra: all
39
+ Requires-Dist: numba>=0.56.0; extra == "all"
40
+ Requires-Dist: imageio>=2.20.0; extra == "all"
41
+ Requires-Dist: mpmath>=1.2.0; extra == "all"
42
+ Provides-Extra: dev
43
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
44
+ Dynamic: license-file
45
+
46
+ <div align="center">
47
+ <h1>๐ŸŒ€ FantasticFractals (Python Library & CLI)</h1>
48
+ <p><strong>Vectorized NumPy fractal rendering engine, scientific analysis suite, 4K/8K/16K image exporter & zoom dive generator.</strong></p>
49
+ <p>
50
+ <a href="https://github.com/QuantumTechCoder/FantasticFractals/tree/python"><img src="https://img.shields.io/badge/Python-3.9+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.9+" /></a>
51
+ <a href="https://github.com/QuantumTechCoder/FantasticFractals/releases"><img src="https://img.shields.io/badge/Platform-Windows_AMD64-0078D6?style=flat-square&logo=windows" alt="Windows AMD64" /></a>
52
+ <a href="https://numpy.org"><img src="https://img.shields.io/badge/NumPy-Vectorized-013243?style=flat-square&logo=numpy" alt="NumPy Vectorized" /></a>
53
+ <a href="https://pillow.readthedocs.io"><img src="https://img.shields.io/badge/Pillow-16K_Export-11557c?style=flat-square" alt="Pillow 16K Export" /></a>
54
+ <a href="https://docs.pytest.org"><img src="https://img.shields.io/badge/pytest-19_passed-brightgreen?style=flat-square&logo=pytest" alt="pytest: 19 passed" /></a>
55
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-slate?style=flat-square" alt="License: MIT" /></a>
56
+ </p>
57
+ <p>
58
+ ๐ŸŒ <strong><a href="https://fantasticfractals.pages.dev">Try the Live Web App (WebGL 2.0)</a></strong> |
59
+ ๐Ÿ“‚ <strong><a href="https://github.com/QuantumTechCoder/FantasticFractals">Main Navigation Hub</a></strong>
60
+ </p>
61
+ </div>
62
+
63
+ > [!IMPORTANT]
64
+ > ### ๐Ÿ“ Repository Ecosystem & Branch Directory
65
+ > This library is part of the **FantasticFractals** multi-branch ecosystem:
66
+ >
67
+ > | Branch | Status | Description & Stack | Direct Link |
68
+ > | :--- | :---: | :--- | :---: |
69
+ > | **`main`** | ๐ŸŸข Active | **Central Navigation Hub & Roadmap**. Overview documentation index. | [View Index](https://github.com/QuantumTechCoder/FantasticFractals) |
70
+ > | **`website`** | ๐Ÿš€ **Live** | **Web Application & Edge API**. React 18, Vite, WebGL 2.0 shaders, Tailwind CSS. | [Explore `website` Branch โ†’](https://github.com/QuantumTechCoder/FantasticFractals/tree/website) |
71
+ > | **`python`** | ๐ŸŸข **Active** | **Scientific Library & CLI**. Vectorized NumPy computation, 16K export, box dimension analysis. *(You are here)* | [View `python` Branch](https://github.com/QuantumTechCoder/FantasticFractals/tree/python) |
72
+ > | *`nodejs`* | ๐Ÿ› ๏ธ *Planned* | **NPM Package & Utilities**. Standalone procedural rendering engine and CLI for asset generation. | *Coming Soon* |
73
+
74
+ ---
75
+
76
+ ## ๐ŸŒŸ Overview
77
+
78
+ `fantasticfractals` is a high-performance Python package for computing, analyzing, and exporting fractal geometry. Built on top of vectorized **NumPy** array operations and **Pillow**, it brings 27 mathematical fractals to scientific notebooks, command-line scripts, and creative pipelines without requiring heavy external dependencies.
79
+
80
+ ```text
81
+ .---. _ _ _
82
+ / \ | | | | | |
83
+ z_{n+1} = | z_n |ยฒ + c | |__ ___ __ _ __| | | | ___ ___ _ __
84
+ \ / | '_ \ / _ \/ _` |/ _` | | |/ _ \ / _ \| '_ \
85
+ '---' | | | | __/ (_| | (_| | | | (_) | (_) | |_) |
86
+ |_| |_|\___|\__,_|\__,_| |_|\___/ \___/| .__/
87
+ | |
88
+ Vectorized NumPy โ€ข 27 Fractal Systems โ€ข 16K Ultra-HD โ€ข CLI & Python SDK|_|
89
+ ```
90
+
91
+ ---
92
+
93
+ ## โœจ Features
94
+
95
+ - ๐Ÿ“ **27 Mathematical Fractals**: Complete analytical support for Mandelbrot, Julia, Burning Ship, Tricorn, Multibrots, Newton basins, Nova, Magnet rational maps, Feather, Sierpinski Triangle/Carpet, Koch Snowflake, Vicsek, Apollonian Inversion Gasket, Dragon Curve, Collatz dynamics, Lyapunov exponents, and Barnsley Fern IFS.
96
+ - ๐Ÿš€ **Vectorized NumPy Operations**: Pure broadcasted matrix computations running efficiently on any standard Python installation.
97
+ - ๐ŸŽจ **Smooth Fractional Potential**: Continuous iteration bands and logarithmic exterior distance smoothing to eliminate color stepping.
98
+ - ๐ŸŒˆ **8 Signature Color Palettes**: Built-in palettes (`cyberpunk`, `fire`, `ocean`, `emerald`, `rainbow`, `sunset`, `monochrome`, `psychedelic`) with customizable phase shifts and loop repetitions.
99
+ - ๐Ÿ–ผ๏ธ **Ultra-HD Image Exporter**: Render wallpapers and publication-grade renders with presets from `720p`, `1080p`, `1440p`, `4k`, `8k`, up to `16k` (15360 ร— 8640).
100
+ - ๐Ÿ”ฌ **Minkowski-Bouligand Box Dimension**: Calculate the empirical Hausdorff/box-counting fractal dimension $D = \lim_{\epsilon \to 0} \frac{\log N(\epsilon)}{\log(1/\epsilon)}$ directly from iteration grids.
101
+ - ๐ŸŽฌ **Zoom Dive & Evolution Animations**: Export smooth zooming GIF and MP4 animations or iteration-evolution sequences.
102
+ - ๐Ÿ’ป **Complete CLI**: Render, analyze, and inspect fractals straight from the terminal.
103
+
104
+ ---
105
+
106
+ ## ๐Ÿ“ฆ Installation & Packaging
107
+
108
+ ### Option 1: Direct Install via Wheel (Windows AMD64 / Universal)
109
+
110
+ Download the pre-compiled `.whl` from the [Latest GitHub Release](https://github.com/QuantumTechCoder/FantasticFractals/releases) and install via pip:
111
+
112
+ ```powershell
113
+ pip install https://github.com/QuantumTechCoder/FantasticFractals/releases/download/v1.0.0-python/fantasticfractals-1.0.0-py3-none-win_amd64.whl
114
+ ```
115
+
116
+ ### Option 2: Clone & Build from Source
117
+
118
+ ```bash
119
+ # 1. Clone the python branch
120
+ git clone -b python https://github.com/QuantumTechCoder/FantasticFractals.git
121
+ cd FantasticFractals
122
+
123
+ # 2. Install in editable mode
124
+ pip install -e .
125
+
126
+ # 3. Or build standalone distributions using build and wheel (PEP 517 / pyproject.toml):
127
+ pip install build wheel twine
128
+ python -m build
129
+ twine check dist/*
130
+ ```
131
+
132
+ ---
133
+
134
+ ## ๐Ÿš€ Quickstart: Python SDK
135
+
136
+ ### 1. Render and Save a High-Resolution Fractal
137
+
138
+ ```python
139
+ from fantasticfractals import render_fractal, export_image
140
+
141
+ # Render a Burning Ship fractal with the cyberpunk palette
142
+ image = render_fractal(
143
+ fractal_type="burning_ship",
144
+ width=1920,
145
+ height=1080,
146
+ palette="cyberpunk",
147
+ max_iterations=300,
148
+ )
149
+
150
+ # Save directly to disk
151
+ image.save("burning_ship.png")
152
+
153
+ # Or use resolution presets up to 16K:
154
+ export_image(
155
+ "mandelbrot",
156
+ "mandelbrot_4k.png",
157
+ preset="4k",
158
+ palette="ocean"
159
+ )
160
+ ```
161
+
162
+ ### 2. Compute the Box-Counting Fractal Dimension
163
+
164
+ ```python
165
+ from fantasticfractals import FractalEngine, compute_box_dimension
166
+
167
+ # Generate raw iteration matrix
168
+ engine = FractalEngine()
169
+ raw_grid = engine.render_raw("sierpinski_triangle", width=1024, height=1024, max_iter=20)
170
+
171
+ # Compute Minkowski-Bouligand dimension
172
+ dim, r_squared, scales, counts = compute_box_dimension(raw_grid)
173
+ print(f"Empirical Box Dimension: {dim:.4f} (Rยฒ = {r_squared:.4f})")
174
+ # Expected for Sierpinski Triangle: log(3)/log(2) โ‰ˆ 1.585
175
+ ```
176
+
177
+ ### 3. Generate a Deep Zoom Video / GIF
178
+
179
+ ```python
180
+ from fantasticfractals import create_zoom_animation
181
+
182
+ create_zoom_animation(
183
+ fractal_type="mandelbrot",
184
+ output_path="mandelbrot_zoom.gif",
185
+ center=(-0.743643887037158704752191506114774, 0.131825904205311970493132056385139),
186
+ start_zoom=1.0,
187
+ end_zoom=1500.0,
188
+ frames=60,
189
+ fps=15,
190
+ width=640,
191
+ height=360,
192
+ palette="fire"
193
+ )
194
+ ```
195
+
196
+ ---
197
+
198
+ ## ๐Ÿ’ป Command Line Interface (CLI)
199
+
200
+ The package installs the `fantasticfractals` command (or `python -m fantasticfractals.cli.main`):
201
+
202
+ ### List All Fractals
203
+ ```bash
204
+ fantasticfractals list
205
+ ```
206
+
207
+ ### View Mathematical Details
208
+ ```bash
209
+ fantasticfractals info mandelbrot
210
+ fantasticfractals info magnet1
211
+ ```
212
+
213
+ ### Render Ultra-HD Images
214
+ ```bash
215
+ # Render 4K Burning Ship
216
+ fantasticfractals render --type burning_ship --res 4k --palette cyberpunk --out burning_ship_4k.png
217
+
218
+ # Render Julia Set with custom complex constant c = -0.7 + 0.27015i
219
+ fantasticfractals render --type julia --res 1080p --jr -0.7 --ji 0.27015 --palette sunset --out julia.png
220
+ ```
221
+
222
+ ### Compute Fractal Dimension
223
+ ```bash
224
+ fantasticfractals dimension --type koch_snowflake --size 1024
225
+ ```
226
+
227
+ ### Create Zoom Dive Animation
228
+ ```bash
229
+ fantasticfractals video --type mandelbrot --frames 45 --out dive.gif
230
+ ```
231
+
232
+ ---
233
+
234
+ ## ๐Ÿ“š Supported Fractals Catalog (27 Systems)
235
+
236
+ | Category | Fractal ID | Mathematical Formulation | Default Center $(x, y)$ |
237
+ | :--- | :--- | :--- | :--- |
238
+ | **Classical Escape** | `mandelbrot` | $z_{n+1} = z_n^2 + c$ | $(-0.5, 0.0)$ |
239
+ | | `julia` | $z_{n+1} = z_n^2 + c_{const}$ | $(0.0, 0.0)$ |
240
+ | **Non-Analytic** | `burning_ship` | $z_{n+1} = (\|\text{Re}(z_n)\| + i\|\text{Im}(z_n)\|)^2 + c$ | $(-0.45, -0.5)$ |
241
+ | | `celtic_mandelbrot` | $z_{n+1} = (\|\text{Re}(z_n^2 - c)\| + i\,\text{Im}(z_n^2)) + c$ | $(-0.8, 0.0)$ |
242
+ | | `buffalo` | $z_{n+1} = (\|\text{Re}(z_n)\| + i\|\text{Im}(z_n)\|)^2 - \|\text{Re}(z_n)\| + c$ | $(-0.4, -0.2)$ |
243
+ | | `perp_mandelbrot` | $z_{n+1} = (\text{Re}(z_n) - i\|\text{Im}(z_n)\|)^2 + c$ | $(-0.5, 0.0)$ |
244
+ | | `perp_burning_ship`| $z_{n+1} = (\|\text{Re}(z_n)\| - i\,\text{Im}(z_n))^2 + c$ | $(-0.45, -0.5)$ |
245
+ | **Conjugate Escape** | `tricorn` | $z_{n+1} = \bar{z}_n^2 + c$ | $(0.0, 0.0)$ |
246
+ | | `multibar3` | $z_{n+1} = \bar{z}_n^3 + c$ | $(0.0, 0.0)$ |
247
+ | **Higher Order** | `multibrot3` | $z_{n+1} = z_n^3 + c$ | $(0.0, 0.0)$ |
248
+ | | `multibrot4` | $z_{n+1} = z_n^4 + c$ | $(0.0, 0.0)$ |
249
+ | **Convergence Basins**| `newton` | $z_{n+1} = z_n - \frac{z_n^3 - 1}{3 z_n^2}$ | $(0.0, 0.0)$ |
250
+ | | `newton_z4` | $z_{n+1} = z_n - \frac{z_n^4 - 1}{4 z_n^3}$ | $(0.0, 0.0)$ |
251
+ | | `nova` | $z_{n+1} = z_n - R \frac{z_n^3 - 1}{3 z_n^2} + c$ | $(0.0, 0.0)$ |
252
+ | **Physics & Rational** | `magnet1` | $z_{n+1} = \left(\frac{z_n^2 + c - 1}{2z_n + c - 2}\right)^2$ | $(0.5, 0.0)$ |
253
+ | | `magnet2` | $z_{n+1} = \left(\frac{z_n^3 + 3(c-1)z_n + (c-1)(c-2)}{3z_n^2 + 3(c-2)z_n + (c-1)(c-2) + 1}\right)^2$ | $(0.5, 0.0)$ |
254
+ | | `feather` | $z_{n+1} = \frac{z_n^3}{1 + z_n^2} + c$ | $(-0.2, 0.0)$ |
255
+ | **Geometric / IFS** | `sierpinski_triangle` | Midpoint affine contraction / bitwise XOR metric | $(0.0, -0.15)$ |
256
+ | | `koch_snowflake` | Boundary fold generator / IFS segment limit | $(0.0, 0.0)$ |
257
+ | | `vicsek` | 5-box cross decomposition | $(0.0, 0.0)$ |
258
+ | | `sierpinski_carpet` | 8-box 3ร—3 square subgrid removal | $(0.0, 0.0)$ |
259
+ | | `cantor_dust` | 4-corner tensor product Cartesian dust | $(0.0, 0.0)$ |
260
+ | | `apollonian` | Tangent sphere circle inversion gasket | $(0.0, 0.0)$ |
261
+ | | `dragon_curve` | Heighway 90ยฐ rotation unfold limit | $(0.2, 0.0)$ |
262
+ | **Dynamical Systems** | `collatz` | Complex analytic extension $z/2 \cos^2(\pi z/2) + \frac{3z+1}{2} \sin^2(\pi z/2)$ | $(0.0, 0.0)$ |
263
+ | | `lyapunov` | Exponent $\lambda = \lim_{N\to\infty} \frac{1}{N}\sum \ln \|r_n(1 - 2x_n)\|$ | $(3.8, 3.8)$ |
264
+ | | `barnsley_fern` | Affine transformation attractor IFS | $(0.0, 4.8)$ |
265
+
266
+ ---
267
+
268
+ ## ๐Ÿงช Testing
269
+
270
+ The library includes an extensive test suite verifying algorithm stability, registry schemas, array bounds, image exporters, and dimension estimators:
271
+
272
+ ```bash
273
+ # Run pytest
274
+ pytest
275
+ ```
276
+
277
+ ```text
278
+ tests/test_analysis.py .. [ 10%]
279
+ tests/test_registry.py .... [ 31%]
280
+ tests/test_render.py ............. [100%]
281
+
282
+ ============================= 19 passed in 0.41s ==============================
283
+ ```
284
+
285
+ ---
286
+
287
+ ## ๐Ÿ“„ License
288
+
289
+ This project is open-source under the [MIT License](LICENSE).
@@ -0,0 +1,244 @@
1
+ <div align="center">
2
+ <h1>๐ŸŒ€ FantasticFractals (Python Library & CLI)</h1>
3
+ <p><strong>Vectorized NumPy fractal rendering engine, scientific analysis suite, 4K/8K/16K image exporter & zoom dive generator.</strong></p>
4
+ <p>
5
+ <a href="https://github.com/QuantumTechCoder/FantasticFractals/tree/python"><img src="https://img.shields.io/badge/Python-3.9+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.9+" /></a>
6
+ <a href="https://github.com/QuantumTechCoder/FantasticFractals/releases"><img src="https://img.shields.io/badge/Platform-Windows_AMD64-0078D6?style=flat-square&logo=windows" alt="Windows AMD64" /></a>
7
+ <a href="https://numpy.org"><img src="https://img.shields.io/badge/NumPy-Vectorized-013243?style=flat-square&logo=numpy" alt="NumPy Vectorized" /></a>
8
+ <a href="https://pillow.readthedocs.io"><img src="https://img.shields.io/badge/Pillow-16K_Export-11557c?style=flat-square" alt="Pillow 16K Export" /></a>
9
+ <a href="https://docs.pytest.org"><img src="https://img.shields.io/badge/pytest-19_passed-brightgreen?style=flat-square&logo=pytest" alt="pytest: 19 passed" /></a>
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-slate?style=flat-square" alt="License: MIT" /></a>
11
+ </p>
12
+ <p>
13
+ ๐ŸŒ <strong><a href="https://fantasticfractals.pages.dev">Try the Live Web App (WebGL 2.0)</a></strong> |
14
+ ๐Ÿ“‚ <strong><a href="https://github.com/QuantumTechCoder/FantasticFractals">Main Navigation Hub</a></strong>
15
+ </p>
16
+ </div>
17
+
18
+ > [!IMPORTANT]
19
+ > ### ๐Ÿ“ Repository Ecosystem & Branch Directory
20
+ > This library is part of the **FantasticFractals** multi-branch ecosystem:
21
+ >
22
+ > | Branch | Status | Description & Stack | Direct Link |
23
+ > | :--- | :---: | :--- | :---: |
24
+ > | **`main`** | ๐ŸŸข Active | **Central Navigation Hub & Roadmap**. Overview documentation index. | [View Index](https://github.com/QuantumTechCoder/FantasticFractals) |
25
+ > | **`website`** | ๐Ÿš€ **Live** | **Web Application & Edge API**. React 18, Vite, WebGL 2.0 shaders, Tailwind CSS. | [Explore `website` Branch โ†’](https://github.com/QuantumTechCoder/FantasticFractals/tree/website) |
26
+ > | **`python`** | ๐ŸŸข **Active** | **Scientific Library & CLI**. Vectorized NumPy computation, 16K export, box dimension analysis. *(You are here)* | [View `python` Branch](https://github.com/QuantumTechCoder/FantasticFractals/tree/python) |
27
+ > | *`nodejs`* | ๐Ÿ› ๏ธ *Planned* | **NPM Package & Utilities**. Standalone procedural rendering engine and CLI for asset generation. | *Coming Soon* |
28
+
29
+ ---
30
+
31
+ ## ๐ŸŒŸ Overview
32
+
33
+ `fantasticfractals` is a high-performance Python package for computing, analyzing, and exporting fractal geometry. Built on top of vectorized **NumPy** array operations and **Pillow**, it brings 27 mathematical fractals to scientific notebooks, command-line scripts, and creative pipelines without requiring heavy external dependencies.
34
+
35
+ ```text
36
+ .---. _ _ _
37
+ / \ | | | | | |
38
+ z_{n+1} = | z_n |ยฒ + c | |__ ___ __ _ __| | | | ___ ___ _ __
39
+ \ / | '_ \ / _ \/ _` |/ _` | | |/ _ \ / _ \| '_ \
40
+ '---' | | | | __/ (_| | (_| | | | (_) | (_) | |_) |
41
+ |_| |_|\___|\__,_|\__,_| |_|\___/ \___/| .__/
42
+ | |
43
+ Vectorized NumPy โ€ข 27 Fractal Systems โ€ข 16K Ultra-HD โ€ข CLI & Python SDK|_|
44
+ ```
45
+
46
+ ---
47
+
48
+ ## โœจ Features
49
+
50
+ - ๐Ÿ“ **27 Mathematical Fractals**: Complete analytical support for Mandelbrot, Julia, Burning Ship, Tricorn, Multibrots, Newton basins, Nova, Magnet rational maps, Feather, Sierpinski Triangle/Carpet, Koch Snowflake, Vicsek, Apollonian Inversion Gasket, Dragon Curve, Collatz dynamics, Lyapunov exponents, and Barnsley Fern IFS.
51
+ - ๐Ÿš€ **Vectorized NumPy Operations**: Pure broadcasted matrix computations running efficiently on any standard Python installation.
52
+ - ๐ŸŽจ **Smooth Fractional Potential**: Continuous iteration bands and logarithmic exterior distance smoothing to eliminate color stepping.
53
+ - ๐ŸŒˆ **8 Signature Color Palettes**: Built-in palettes (`cyberpunk`, `fire`, `ocean`, `emerald`, `rainbow`, `sunset`, `monochrome`, `psychedelic`) with customizable phase shifts and loop repetitions.
54
+ - ๐Ÿ–ผ๏ธ **Ultra-HD Image Exporter**: Render wallpapers and publication-grade renders with presets from `720p`, `1080p`, `1440p`, `4k`, `8k`, up to `16k` (15360 ร— 8640).
55
+ - ๐Ÿ”ฌ **Minkowski-Bouligand Box Dimension**: Calculate the empirical Hausdorff/box-counting fractal dimension $D = \lim_{\epsilon \to 0} \frac{\log N(\epsilon)}{\log(1/\epsilon)}$ directly from iteration grids.
56
+ - ๐ŸŽฌ **Zoom Dive & Evolution Animations**: Export smooth zooming GIF and MP4 animations or iteration-evolution sequences.
57
+ - ๐Ÿ’ป **Complete CLI**: Render, analyze, and inspect fractals straight from the terminal.
58
+
59
+ ---
60
+
61
+ ## ๐Ÿ“ฆ Installation & Packaging
62
+
63
+ ### Option 1: Direct Install via Wheel (Windows AMD64 / Universal)
64
+
65
+ Download the pre-compiled `.whl` from the [Latest GitHub Release](https://github.com/QuantumTechCoder/FantasticFractals/releases) and install via pip:
66
+
67
+ ```powershell
68
+ pip install https://github.com/QuantumTechCoder/FantasticFractals/releases/download/v1.0.0-python/fantasticfractals-1.0.0-py3-none-win_amd64.whl
69
+ ```
70
+
71
+ ### Option 2: Clone & Build from Source
72
+
73
+ ```bash
74
+ # 1. Clone the python branch
75
+ git clone -b python https://github.com/QuantumTechCoder/FantasticFractals.git
76
+ cd FantasticFractals
77
+
78
+ # 2. Install in editable mode
79
+ pip install -e .
80
+
81
+ # 3. Or build standalone distributions using build and wheel (PEP 517 / pyproject.toml):
82
+ pip install build wheel twine
83
+ python -m build
84
+ twine check dist/*
85
+ ```
86
+
87
+ ---
88
+
89
+ ## ๐Ÿš€ Quickstart: Python SDK
90
+
91
+ ### 1. Render and Save a High-Resolution Fractal
92
+
93
+ ```python
94
+ from fantasticfractals import render_fractal, export_image
95
+
96
+ # Render a Burning Ship fractal with the cyberpunk palette
97
+ image = render_fractal(
98
+ fractal_type="burning_ship",
99
+ width=1920,
100
+ height=1080,
101
+ palette="cyberpunk",
102
+ max_iterations=300,
103
+ )
104
+
105
+ # Save directly to disk
106
+ image.save("burning_ship.png")
107
+
108
+ # Or use resolution presets up to 16K:
109
+ export_image(
110
+ "mandelbrot",
111
+ "mandelbrot_4k.png",
112
+ preset="4k",
113
+ palette="ocean"
114
+ )
115
+ ```
116
+
117
+ ### 2. Compute the Box-Counting Fractal Dimension
118
+
119
+ ```python
120
+ from fantasticfractals import FractalEngine, compute_box_dimension
121
+
122
+ # Generate raw iteration matrix
123
+ engine = FractalEngine()
124
+ raw_grid = engine.render_raw("sierpinski_triangle", width=1024, height=1024, max_iter=20)
125
+
126
+ # Compute Minkowski-Bouligand dimension
127
+ dim, r_squared, scales, counts = compute_box_dimension(raw_grid)
128
+ print(f"Empirical Box Dimension: {dim:.4f} (Rยฒ = {r_squared:.4f})")
129
+ # Expected for Sierpinski Triangle: log(3)/log(2) โ‰ˆ 1.585
130
+ ```
131
+
132
+ ### 3. Generate a Deep Zoom Video / GIF
133
+
134
+ ```python
135
+ from fantasticfractals import create_zoom_animation
136
+
137
+ create_zoom_animation(
138
+ fractal_type="mandelbrot",
139
+ output_path="mandelbrot_zoom.gif",
140
+ center=(-0.743643887037158704752191506114774, 0.131825904205311970493132056385139),
141
+ start_zoom=1.0,
142
+ end_zoom=1500.0,
143
+ frames=60,
144
+ fps=15,
145
+ width=640,
146
+ height=360,
147
+ palette="fire"
148
+ )
149
+ ```
150
+
151
+ ---
152
+
153
+ ## ๐Ÿ’ป Command Line Interface (CLI)
154
+
155
+ The package installs the `fantasticfractals` command (or `python -m fantasticfractals.cli.main`):
156
+
157
+ ### List All Fractals
158
+ ```bash
159
+ fantasticfractals list
160
+ ```
161
+
162
+ ### View Mathematical Details
163
+ ```bash
164
+ fantasticfractals info mandelbrot
165
+ fantasticfractals info magnet1
166
+ ```
167
+
168
+ ### Render Ultra-HD Images
169
+ ```bash
170
+ # Render 4K Burning Ship
171
+ fantasticfractals render --type burning_ship --res 4k --palette cyberpunk --out burning_ship_4k.png
172
+
173
+ # Render Julia Set with custom complex constant c = -0.7 + 0.27015i
174
+ fantasticfractals render --type julia --res 1080p --jr -0.7 --ji 0.27015 --palette sunset --out julia.png
175
+ ```
176
+
177
+ ### Compute Fractal Dimension
178
+ ```bash
179
+ fantasticfractals dimension --type koch_snowflake --size 1024
180
+ ```
181
+
182
+ ### Create Zoom Dive Animation
183
+ ```bash
184
+ fantasticfractals video --type mandelbrot --frames 45 --out dive.gif
185
+ ```
186
+
187
+ ---
188
+
189
+ ## ๐Ÿ“š Supported Fractals Catalog (27 Systems)
190
+
191
+ | Category | Fractal ID | Mathematical Formulation | Default Center $(x, y)$ |
192
+ | :--- | :--- | :--- | :--- |
193
+ | **Classical Escape** | `mandelbrot` | $z_{n+1} = z_n^2 + c$ | $(-0.5, 0.0)$ |
194
+ | | `julia` | $z_{n+1} = z_n^2 + c_{const}$ | $(0.0, 0.0)$ |
195
+ | **Non-Analytic** | `burning_ship` | $z_{n+1} = (\|\text{Re}(z_n)\| + i\|\text{Im}(z_n)\|)^2 + c$ | $(-0.45, -0.5)$ |
196
+ | | `celtic_mandelbrot` | $z_{n+1} = (\|\text{Re}(z_n^2 - c)\| + i\,\text{Im}(z_n^2)) + c$ | $(-0.8, 0.0)$ |
197
+ | | `buffalo` | $z_{n+1} = (\|\text{Re}(z_n)\| + i\|\text{Im}(z_n)\|)^2 - \|\text{Re}(z_n)\| + c$ | $(-0.4, -0.2)$ |
198
+ | | `perp_mandelbrot` | $z_{n+1} = (\text{Re}(z_n) - i\|\text{Im}(z_n)\|)^2 + c$ | $(-0.5, 0.0)$ |
199
+ | | `perp_burning_ship`| $z_{n+1} = (\|\text{Re}(z_n)\| - i\,\text{Im}(z_n))^2 + c$ | $(-0.45, -0.5)$ |
200
+ | **Conjugate Escape** | `tricorn` | $z_{n+1} = \bar{z}_n^2 + c$ | $(0.0, 0.0)$ |
201
+ | | `multibar3` | $z_{n+1} = \bar{z}_n^3 + c$ | $(0.0, 0.0)$ |
202
+ | **Higher Order** | `multibrot3` | $z_{n+1} = z_n^3 + c$ | $(0.0, 0.0)$ |
203
+ | | `multibrot4` | $z_{n+1} = z_n^4 + c$ | $(0.0, 0.0)$ |
204
+ | **Convergence Basins**| `newton` | $z_{n+1} = z_n - \frac{z_n^3 - 1}{3 z_n^2}$ | $(0.0, 0.0)$ |
205
+ | | `newton_z4` | $z_{n+1} = z_n - \frac{z_n^4 - 1}{4 z_n^3}$ | $(0.0, 0.0)$ |
206
+ | | `nova` | $z_{n+1} = z_n - R \frac{z_n^3 - 1}{3 z_n^2} + c$ | $(0.0, 0.0)$ |
207
+ | **Physics & Rational** | `magnet1` | $z_{n+1} = \left(\frac{z_n^2 + c - 1}{2z_n + c - 2}\right)^2$ | $(0.5, 0.0)$ |
208
+ | | `magnet2` | $z_{n+1} = \left(\frac{z_n^3 + 3(c-1)z_n + (c-1)(c-2)}{3z_n^2 + 3(c-2)z_n + (c-1)(c-2) + 1}\right)^2$ | $(0.5, 0.0)$ |
209
+ | | `feather` | $z_{n+1} = \frac{z_n^3}{1 + z_n^2} + c$ | $(-0.2, 0.0)$ |
210
+ | **Geometric / IFS** | `sierpinski_triangle` | Midpoint affine contraction / bitwise XOR metric | $(0.0, -0.15)$ |
211
+ | | `koch_snowflake` | Boundary fold generator / IFS segment limit | $(0.0, 0.0)$ |
212
+ | | `vicsek` | 5-box cross decomposition | $(0.0, 0.0)$ |
213
+ | | `sierpinski_carpet` | 8-box 3ร—3 square subgrid removal | $(0.0, 0.0)$ |
214
+ | | `cantor_dust` | 4-corner tensor product Cartesian dust | $(0.0, 0.0)$ |
215
+ | | `apollonian` | Tangent sphere circle inversion gasket | $(0.0, 0.0)$ |
216
+ | | `dragon_curve` | Heighway 90ยฐ rotation unfold limit | $(0.2, 0.0)$ |
217
+ | **Dynamical Systems** | `collatz` | Complex analytic extension $z/2 \cos^2(\pi z/2) + \frac{3z+1}{2} \sin^2(\pi z/2)$ | $(0.0, 0.0)$ |
218
+ | | `lyapunov` | Exponent $\lambda = \lim_{N\to\infty} \frac{1}{N}\sum \ln \|r_n(1 - 2x_n)\|$ | $(3.8, 3.8)$ |
219
+ | | `barnsley_fern` | Affine transformation attractor IFS | $(0.0, 4.8)$ |
220
+
221
+ ---
222
+
223
+ ## ๐Ÿงช Testing
224
+
225
+ The library includes an extensive test suite verifying algorithm stability, registry schemas, array bounds, image exporters, and dimension estimators:
226
+
227
+ ```bash
228
+ # Run pytest
229
+ pytest
230
+ ```
231
+
232
+ ```text
233
+ tests/test_analysis.py .. [ 10%]
234
+ tests/test_registry.py .... [ 31%]
235
+ tests/test_render.py ............. [100%]
236
+
237
+ ============================= 19 passed in 0.41s ==============================
238
+ ```
239
+
240
+ ---
241
+
242
+ ## ๐Ÿ“„ License
243
+
244
+ This project is open-source under the [MIT License](LICENSE).
@@ -0,0 +1,73 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "fantasticfractals"
7
+ version = "1.0.0"
8
+ description = "High-performance mathematical fractal generator, arbitrary-precision deep zoom engine, and 4K/video exporter."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ authors = [
13
+ { name = "FantasticFractals Contributors" }
14
+ ]
15
+ keywords = [
16
+ "fractals",
17
+ "mandelbrot",
18
+ "julia-set",
19
+ "chaos-theory",
20
+ "mathematics",
21
+ "visualization",
22
+ "deep-zoom",
23
+ "generative-art",
24
+ "numba",
25
+ "numpy"
26
+ ]
27
+ classifiers = [
28
+ "Development Status :: 5 - Production/Stable",
29
+ "Intended Audience :: Science/Research",
30
+ "Intended Audience :: Developers",
31
+ "Topic :: Scientific/Engineering :: Mathematics",
32
+ "Topic :: Scientific/Engineering :: Visualization",
33
+ "Topic :: Multimedia :: Graphics",
34
+ "Operating System :: Microsoft :: Windows",
35
+ "Environment :: Win32 (MS Windows)",
36
+ "Programming Language :: Python :: 3",
37
+ "Programming Language :: Python :: 3.9",
38
+ "Programming Language :: Python :: 3.10",
39
+ "Programming Language :: Python :: 3.11",
40
+ "Programming Language :: Python :: 3.12",
41
+ "Programming Language :: Python :: 3.13",
42
+ ]
43
+
44
+ dependencies = [
45
+ "numpy>=1.22.0",
46
+ "pillow>=9.0.0"
47
+ ]
48
+
49
+ [project.optional-dependencies]
50
+ accelerate = ["numba>=0.56.0"]
51
+ video = ["imageio>=2.20.0"]
52
+ precision = ["mpmath>=1.2.0"]
53
+ all = [
54
+ "numba>=0.56.0",
55
+ "imageio>=2.20.0",
56
+ "mpmath>=1.2.0"
57
+ ]
58
+ dev = [
59
+ "pytest>=7.0.0"
60
+ ]
61
+
62
+ [project.scripts]
63
+ fantasticfractals = "fantasticfractals.cli.main:main"
64
+
65
+ [project.urls]
66
+ Homepage = "https://fantasticfractals.pages.dev"
67
+ Repository = "https://github.com/QuantumTechCoder/FantasticFractals/tree/python"
68
+ WebVersion = "https://github.com/QuantumTechCoder/FantasticFractals/tree/website"
69
+ Documentation = "https://github.com/QuantumTechCoder/FantasticFractals/tree/python#readme"
70
+ Issues = "https://github.com/QuantumTechCoder/FantasticFractals/issues"
71
+
72
+ [tool.setuptools.packages.find]
73
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+