High-Performance Fractal Generation and Wallpaper Creator
Generate stunning fractal visualizations including Mandelbrot sets, Julia sets, and other escape-time fractals. Features real-time parameter adjustment, multiple color palettes, and high-resolution export capabilities for creating beautiful wallpapers.
- Mandelbrot Set - The classic fractal with infinite detail
- Julia Sets - Beautiful variations with complex parameters
- Burning Ship - Dramatic fractal resembling a ship
- Extensible - Easy to add new fractal algorithms
- Predefined Palettes - Classic, Fire, Ocean, Sunset, Cosmic, Electric, and more
- Custom Gradients - Create your own color schemes
- Smooth Coloring - Eliminates banding artifacts
- Color Enhancement - Contrast, brightness, and saturation controls
- Multiple Color Spaces - RGB, HSV, LAB support
- Multiple Resolutions - HD, Full HD, QHD, 4K, 8K support
- Wallpaper Presets - Standard desktop and mobile sizes
- Format Options - PNG, JPEG, WebP export
- Batch Export - Generate multiple resolutions at once
- Quality Controls - Compression and optimization settings
- Numba JIT Compilation - Lightning-fast computation
- Parallel Processing - Multi-core CPU utilization
- Memory Efficient - Handles large images smoothly
- Real-time Preview - Interactive parameter adjustment
- Streamlit-based UI - Beautiful, intuitive interface
- Real-time Generation - See changes instantly
- Parameter Controls - Zoom, pan, color adjustments
- Preset Points - Explore interesting fractal locations
- Export Integration - Direct wallpaper generation
-
Clone the repository
git clone https://github.com/fractals/fractal-visualizer.git cd fractal-visualizer -
Install dependencies
pip install -r requirements.txt
-
Launch the web interface
python main.py
-
Open your browser to the displayed URL (usually
http://localhost:8501)
# Launch web interface (default)
python main.py
# Generate sample wallpapers
python main.py --samples
# Show help
python main.py --helpfrom src.fractal_engine import FractalEngine, FractalConfig
from src.color_engine import ColorEngine, PaletteType
from src.export_engine import ExportEngine
# Create engines
fractal_engine = FractalEngine()
color_engine = ColorEngine()
export_engine = ExportEngine()
# Configure fractal
config = FractalConfig(
width=1920, height=1080,
max_iter=256, zoom=1.0
)
# Generate Mandelbrot set
iterations = fractal_engine.generate_mandelbrot(config)
# Apply colors
rgb_image = color_engine.apply_color_mapping(
iterations, PaletteType.FIRE, smooth=True
)
# Export as wallpaper
export_engine.save_image(rgb_image, \"mandelbrot.png\")The web interface provides:
- Real-time fractal generation with parameter sliders
- Multiple fractal types with easy switching
- Color palette selection with live preview
- Zoom and pan controls for exploration
- Export options for multiple resolutions
- Preset interesting points to explore
# Generate wallpapers in multiple resolutions
resolutions = ['Full HD', 'QHD', '4K', 'Ultrawide 2K']
saved_files = export_engine.save_wallpaper_set(
rgb_image, \"my_fractal\", resolutions
)| Palette | Description | Best For |
|---|---|---|
| Classic | Traditional Mandelbrot colors | Classic fractals |
| Fire | Warm oranges and reds | Dramatic effects |
| Ocean | Cool blues and cyans | Calm, flowing fractals |
| Sunset | Purple to yellow gradient | Artistic wallpapers |
| Cosmic | Deep purples and violets | Space-themed images |
| Electric | Blue to white lightning | High-contrast details |
| Monochrome | Grayscale gradient | Minimalist designs |
# Create custom gradient
custom_palette = color_engine.create_gradient_palette(
start_color=(0.1, 0.0, 0.2), # Dark purple
end_color=(1.0, 0.8, 0.3) # Gold
)
# Apply to fractal
rgb_image = color_engine.apply_color_mapping(
iterations, custom_palette
)- HD: 1280Γ720
- Full HD: 1920Γ1080
- QHD: 2560Γ1440
- 4K: 3840Γ2160
- 8K: 7680Γ4320
- Ultrawide 2K: 3440Γ1440
- Ultrawide 4K: 5120Γ2160
- Mobile HD: 720Γ1280
- Mobile FHD: 1080Γ1920
- Mobile QHD: 1440Γ2560
# Any custom resolution
custom_config = FractalConfig(width=5000, height=3000)| Location | Coordinates | Zoom | Description |
|---|---|---|---|
| Overview | (-0.5, 0.0) | 1Γ | Classic full view |
| Seahorse Valley | (-0.75, 0.1) | 50Γ | Intricate seahorse patterns |
| Elephant Valley | (0.25, 0.0) | 100Γ | Elephant-like bulb detail |
| Lightning | (-1.775, 0.0) | 1000Γ | Lightning-like tendrils |
| Spiral | (-0.7456, 0.113) | 2000Γ | Beautiful spiral formations |
# Beautiful Julia set parameters
julia_params = [
{'c_real': -0.4, 'c_imag': 0.6}, # Spiral dragon
{'c_real': -0.8, 'c_imag': 0.156}, # Lightning bolt
{'c_real': 0.285, 'c_imag': 0.01}, # Flower pattern
{'c_real': -0.123, 'c_imag': 0.745} # Crystal formation
]# For real-time exploration (faster)
preview_config = FractalConfig(
width=800, height=600,
max_iter=128
)
# For final wallpapers (higher quality)
export_config = FractalConfig(
width=3840, height=2160,
max_iter=1024
)# Apply post-processing effects
enhanced_image = color_engine.enhance_image(
rgb_image,
contrast=1.2, # Increase contrast
brightness=0.1, # Slight brightness boost
saturation=1.3 # More vivid colors
)# High-quality PNG export
export_config = ExportConfig(
format=\"PNG\",
compression_level=3, # Lower = better quality
optimize=True
)
# High-quality JPEG export
export_config = ExportConfig(
format=\"JPEG\",
quality=98,
optimize=True
)| Resolution | Iterations | Generation Time* | File Size (PNG) |
|---|---|---|---|
| 1920Γ1080 | 256 | ~2-5 seconds | ~8-15 MB |
| 2560Γ1440 | 256 | ~4-8 seconds | ~15-25 MB |
| 3840Γ2160 | 512 | ~15-30 seconds | ~35-60 MB |
| 7680Γ4320 | 1024 | ~60-120 seconds | ~150-300 MB |
*Times vary based on CPU and fractal complexity
fractales/
βββ src/ # Source code
β βββ fractal_engine/ # Core fractal computation
β β βββ core.py # Mandelbrot, Julia, Burning Ship
β β βββ __init__.py
β βββ color_engine/ # Color palettes and mapping
β β βββ palettes.py # Color palette definitions
β β βββ __init__.py
β βββ export_engine/ # Image export and formatting
β β βββ exporter.py # High-res export functionality
β β βββ __init__.py
β βββ web_interface/ # Streamlit web UI
β β βββ app.py # Main Streamlit application
β β βββ __init__.py
β βββ __init__.py
βββ examples/ # Example scripts
β βββ quick_start.py # Basic Mandelbrot generation
β βββ julia_explorer.py # Julia set variations
β βββ deep_zoom.py # High-resolution deep zooms
βββ tests/ # Unit tests
βββ docs/ # Documentation
βββ assets/ # Images and resources
βββ output/ # Generated wallpapers
β βββ wallpapers/ # Final wallpaper exports
β βββ previews/ # Low-res previews
β βββ settings/ # Saved configurations
βββ main.py # Main entry point
βββ requirements.txt # Python dependencies
βββ pyproject.toml # Project configuration
βββ README.md # This file
- NumPy - Numerical computations
- Numba - JIT compilation for performance
- Matplotlib - Color mapping and palettes
- Pillow - Image processing and export
- Streamlit - Web interface
- SciPy - Advanced mathematical functions
- OpenCV - Additional image processing
- Plotly - Interactive plots
- ImageIO - Animation support
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork and clone the repository
- Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\\Scripts\\activate
- Install development dependencies
pip install -e .[dev]
- Run tests
pytest
This project is licensed under the MIT License - see the LICENSE file for details.
- Benoit Mandelbrot - For discovering the Mandelbrot set
- Gaston Julia - For Julia set mathematics
- NumPy/SciPy community - For excellent scientific computing tools
- Streamlit team - For the beautiful web framework
- Documentation: Read the Docs
- Issues: GitHub Issues
- Discussions: GitHub Discussions
**Happy fractal generation! **

