# Fractal Generator Quick Start Guide

## Two Powerful Fractal Tools

Pixcen now includes two comprehensive fractal generators available as **Tool Scripts**:

### 1. IFS Fractals
**Nature-inspired fractals** - Ferns, trees, dragons, and geometric patterns

### 2. Mandelbrot & Julia
**Mathematical escape-time fractals** - The famous Mandelbrot set and variants

---

## Quick Examples

### Generate a Barnsley Fern

1. Go to **Tools → Tool Scripts** (or press **Ctrl+Shift+T**)
2. Select "IFS Fractals"
3. Choose "Barnsley Fern" from the Fractal Type dropdown
4. Click "Run"
5. See beautiful fern appear!

### Generate the Mandelbrot Set

1. Go to **Tools → Tool Scripts** (or press **Ctrl+Shift+T**)
2. Select "Mandelbrot & Julia"
3. Keep default settings (Mandelbrot is selected)
4. Click "Run"
5. See the iconic fractal!

### Generate a Julia Dragon

1. Go to **Tools → Tool Scripts** (or press **Ctrl+Shift+T**)
2. Select "Mandelbrot & Julia"
3. Choose "Julia Set" from Fractal Type dropdown
4. Set Julia Constant (Real) to `-0.7`
5. Set Julia Constant (Imaginary) to `0.27015`
6. Click "Run"
7. See dragon-like patterns!

---

## IFS Fractals - At a Glance

**Access**: Tools → Tool Scripts → "IFS Fractals" (Ctrl+Shift+T)

### Available Types
Select from the **Fractal Type** dropdown:

| Type | Description | Visual |
|------|-------------|--------|
| `barnsley-fern` | Realistic fern leaf | 🌿 Natural |
| `sierpinski-triangle` | Geometric gasket | 🔺 Simple |
| `dragon-curve` | Space-filling curve | 🐉 Intricate |
| `tree` | Branching structure | 🌳 Natural |
| `maple-leaf` | Leaf shape | 🍁 Organic |
| `spiral` | Logarithmic spiral | 🌀 Smooth |
| `pentagon-fractal` | 5-fold symmetry | ⭐ Geometric |
| `koch-snowflake` | Classic snowflake | ❄️ Symmetric |

### Key Settings (adjustable in dialog)
- **Iterations**: 50,000 (more = denser, range: 1k-500k)
- **Use Color Gradient**: Enabled (color by depth)
- **Color Range**: Select which color range to use
- **Clear Canvas First**: Enabled by default

### When to Use
- Want **organic, natural-looking** patterns
- Need **quick** generation (seconds)
- Exploring **self-similar** structures
- Creating **artistic** backgrounds

---

## Mandelbrot & Julia - At a Glance

**Access**: Tools → Tool Scripts → "Mandelbrot & Julia" (Ctrl+Shift+T)

### Available Types
Select from the **Fractal Type** dropdown:

| Type | Description | Formula |
|------|-------------|---------|
| `mandelbrot` | Classic set | z² + c |
| `julia` | Filled shapes | z² + c (c fixed) |
| `burning-ship` | Ship-like | abs(z)² + c |
| `tricorn` | 3-fold symmetry | conj(z)² + c |
| `multibrot-3` | Power 3 | z³ + c |
| `multibrot-4` | Power 4 | z⁴ + c |

### Key Settings for Mandelbrot (adjustable in dialog)
- **Max Iterations**: 256 (detail level, range: 50-2000)
- **Mandelbrot Zoom Level**: 1.0 (zoom in, range: 0.1-1000)
- **Mandelbrot Center X**: -0.75 (pan horizontal, shows full set)
- **Mandelbrot Center Y**: 0.0 (pan vertical)
- **Color Scheme**: Smooth Gradient (7 schemes available)
- **Use Smooth Coloring**: Enabled (eliminates banding)
- **Supersampling**: 1 (off), 2 (4x), or 3 (9x) anti-aliasing

### Key Settings for Julia (adjustable in dialog)
- **Julia Constant (Real)**: -0.7 (shape parameter)
- **Julia Constant (Imaginary)**: 0.27015 (shape parameter)

### When to Use
- Want the **iconic Mandelbrot** set
- Exploring **mathematical** beauty
- Need **zoom** capability (infinite detail)
- Creating **psychedelic** art
- Learning **complex numbers**

---

## Performance Comparison

| Aspect | IFS Fractals | Mandelbrot/Julia |
|--------|--------------|------------------|
| **Speed** | ⚡⚡⚡ Very Fast | ⚡⚡ Moderate |
| **Detail** | Fixed by iterations | Zoom-dependent |
| **Memory** | Low | Low-Medium |
| **Best For** | Natural patterns | Mathematical exploration |
| **Typical Time** | 1-3 seconds | 2-10 seconds |

---

## Color Scheme Quick Reference

### IFS Fractals
- Enable **Use Color Gradient** checkbox for rainbow effect
- Disable for solid color (use **Solid Color** picker)
- Select **Color Range** to choose gradient palette

### Mandelbrot/Julia
Select from **Color Scheme** dropdown:

| Scheme | Look | Best For |
|--------|------|----------|
| `smooth-gradient` | Smooth rainbow | General use ⭐ |
| `banded` | Sharp bands | Retro style |
| `grayscale` | B&W gradient | Structural detail |
| `fire` | Red/orange/yellow | Hot, dramatic |
| `ice` | Blue/cyan/white | Cold, ethereal |
| `psychedelic` | Repeating rainbow | Trippy art |
| `classic` | Traditional palette | Nostalgic |

---

## Beginner's Path

### Day 1: Learn IFS
1. ✓ Open IFS Fractals tool with default settings
2. ✓ Try each Fractal Type from the dropdown
3. ✓ Experiment with Iterations slider (10k, 50k, 100k)
4. ✓ Toggle Use Color Gradient checkbox on/off

### Day 2: Learn Mandelbrot
1. ✓ Open Mandelbrot & Julia tool with defaults
2. ✓ Try different Color Scheme options
3. ✓ Adjust Zoom Level and Center coordinates
4. ✓ Increase Max Iterations for deeper zooms

### Day 3: Explore Julia Sets
1. ✓ Select "Julia Set" from Fractal Type
2. ✓ Try famous Julia constants (see README)
3. ✓ Experiment with Julia Constant sliders
4. ✓ Compare different c values

### Day 4: Master Advanced
1. ✓ Try burning-ship and tricorn fractal types
2. ✓ Increase Supersampling to 2 or 3 for anti-aliasing
3. ✓ Create deep zoom sequences (increase zoom gradually)
4. ✓ Disable Clear Canvas to layer fractals

---

## Troubleshooting in 30 Seconds

### IFS: Nothing visible
- ✓ Increase Iterations to 50000
- ✓ Try different Fractal Type

### IFS: Too sparse
- ✓ Increase Iterations to 100000+

### Mandelbrot: All black
- ✓ Reset Center coordinates to defaults (-0.5, 0.0)
- ✓ Increase Max Iterations

### Mandelbrot: All one color
- ✓ Decrease Zoom Level
- ✓ Increase Max Iterations

### Julia: Nothing interesting
- ✓ Use constants from README
- ✓ Try different Julia Constant values

### Any: Too slow
- ✓ Reduce Max Iterations
- ✓ Set Supersampling to 1
- ✓ Use smaller canvas

---

## Pro Tips

### 💡 IFS Fractals
- **Dense patterns**: Use 200k+ iterations
- **Sparse artistic**: Use 10k-20k iterations
- **Best iterations**: 50k-100k (sweet spot)
- **Color depth**: Enable gradient for more interest

### 💡 Mandelbrot/Julia
- **First time**: Use defaults, don't change anything
- **Deep zoom**: Increase iterations with zoom (zoom × 5)
- **Best quality**: Enable smooth coloring + supersampling 2
- **Fast preview**: Use 128 iterations, no supersampling
- **Final render**: Use 512+ iterations, supersampling 2-3

### 💡 Both
- **Test first**: Use small canvas (160×100) with low iterations
- **Final render**: Use full canvas with higher quality settings
- **Document discoveries**: Write down interesting coordinates/constants
- **Layer fractals**: Disable Clear Canvas to combine multiple fractals

---

## One-Minute Challenges

### Challenge 1: Rainbow Fern
1. Open IFS Fractals tool (Ctrl+Shift+T)
2. Enable "Use Color Gradient"
3. Click Run
4. Time: < 3 seconds

### Challenge 2: Mandelbrot Default
1. Open Mandelbrot & Julia tool (Ctrl+Shift+T)
2. Keep all defaults
3. Click Run
4. See the iconic shape!

### Challenge 3: Dragon Julia
1. Open Mandelbrot & Julia tool
2. Select "Julia Set" from Fractal Type
3. Set Julia Constant (Real) to -0.7
4. Set Julia Constant (Imaginary) to 0.27015
5. Click Run

### Challenge 4: Sierpinski Triangle
1. Open IFS Fractals tool
2. Select "Sierpinski Triangle" from Fractal Type
3. Click Run
4. Math beauty in seconds!

---

## Getting Help

1. **Log window**: Tools print helpful info and progress
2. **README files**: Detailed documentation in `scripts/examples/`
3. **Experimentation**: Try changing ONE parameter at a time
4. **Defaults first**: Always start with default values

## How to Access

**Method 1**: Menu
- Go to **Tools → Tool Scripts**
- Select "IFS Fractals" or "Mandelbrot & Julia"
- Adjust parameters in dialog
- Click "Run"

**Method 2**: Keyboard shortcut
- Press **Ctrl+Shift+T**
- Select tool from list
- Configure and run

## Next Steps

After mastering these fractals:
- Explore other tool scripts in the Tools menu
- Combine fractals with filters and effects
- Create fractal-based sprites and textures
- Use fractals as backgrounds for pixel art
- Layer multiple fractals by disabling "Clear Canvas"

**Happy Fractal Exploring! 🎨✨**
