Rendering Parameters
Fract’ol offers several customizable parameters that affect how fractals are rendered. These can be adjusted both at initialization and during runtime.Color Scheme System
The project uses a psychedelic color palette defined infractol.h:27-44:
Colors are defined in hexadecimal RGB format:
0xRRGGBB. Each pair of digits represents the intensity (00-FF) of red, green, and blue components.Current Color Mapping
The default coloring scheme creates a gradient from lime to mint:Escape Colors
PSYCHEDELIC_LIME → PSYCHEDELIC_MINTGradient from neon lime (0x00FF00) to soft mint (0x98FF98)Fast escapes = bright lime, slow escapes = pale mint
Set Color
WHITE (0xFFFFFF)Points that never escape (in the fractal set)Represents the mathematical set itself
Customizing Colors
To change the color scheme, modify themap function call in fractol_render.c:53-54:
Example Color Schemes
Fire Gradient (Orange to Red)
Fire Gradient (Orange to Red)
Ocean Gradient (Cyan to Blue)
Ocean Gradient (Cyan to Blue)
Sunset (Yellow to Magenta)
Sunset (Yellow to Magenta)
Purple Dream (Lavender to Purple)
Purple Dream (Lavender to Purple)
Inverted (Black on White)
Inverted (Black on White)
You can use any combination of the 16 predefined psychedelic colors, or define your own hex color values.
The Iteration Definition Parameter
Theiterations_definition controls rendering detail and quality:
Default Value
Low (10-30)
Fast renderingGood for explorationLess detail at boundaries
Medium (30-100)
BalancedDefault rangeGood for most viewing
High (100+)
Slow renderingMaximum detailRequired for deep zooms
Runtime Adjustment
Modify during execution using keyboard controls:Each press of + or - changes the iteration count by 5. Hold the key for multiple increments.
The Escape Value Parameter
Theescape_value determines when a point is considered to have escaped to infinity:
How It Works
Why 4? Mathematically, if |z| > 2, the sequence will always diverge. Since we check |z|² = z.x² + z.y², we compare against 4 (which is 2²).
Customizing Escape Value
You can modifyescape_value in fractol_init.c:23 to experiment:
Lower Values (2-3)
Lower Values (2-3)
- Faster escape detection
- More conservative boundary
- May miss some detail
- Faster rendering
Default Value (4)
Default Value (4)
- Standard mathematical threshold
- Proven optimal for fractals
- Best balance of accuracy and speed
Higher Values (5-10)
Higher Values (5-10)
- Later escape detection
- More lenient boundary
- May reveal additional detail
- Slower rendering
Window and Resolution
The rendering resolution is defined at compile time:- Edit
fractol.h:24-25 - Recompile the project
- Higher resolutions = more detail but slower rendering
- Maintain aspect ratio for undistorted fractals
Common resolutions:
- 800×600 (fast, low detail)
- 1920×1080 (HD, good balance)
- 2000×1500 (default, high quality)
- 3840×2160 (4K, very slow)
Initialization Parameters
All default parameters are set indata_init():
Position
shift_x, shift_yStart centered at origin (0, 0)Adjustable with arrow keys/WASD
Zoom
zoomStarts at 1.0 (full view)Adjustable with mouse wheel
Creating Custom Color Functions
For advanced customization, you can implement multi-color gradients by modifying the color mapping logic:The Mapping Function
All parameter interpolation uses themap function from math_utils.c:15:
This function linearly interpolates values from range [0, old_max] to range [new_min, new_max]. It’s used for both coordinate mapping and color gradients.
Performance Tuning
For Fast Exploration
For Fast Exploration
- iterations_definition: 15-25
- Resolution: 1280×720 or lower
- escape_value: 4 (standard)
- Color: Simple gradient (2 colors)
For Quality Viewing
For Quality Viewing
- iterations_definition: 30-50
- Resolution: 2000×1500 (default)
- escape_value: 4 (standard)
- Color: Your preferred gradient
For Deep Zoom/Screenshots
For Deep Zoom/Screenshots
- iterations_definition: 100-500
- Resolution: 3840×2160 or higher
- escape_value: 4 (standard)
- Color: High-contrast gradient
Rendering time scales with WIDTH × HEIGHT × iterations_definition. Doubling any of these approximately doubles render time.