Skip to content

Amitanand983/Frames-based-UI-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandelbrot Fractal Animation Generator 🌟

A Python project that generates beautiful, animated visualizations of the Mandelbrot set fractal. Create stunning zoom animations and high-resolution static images of mathematical art.

Mandelbrot Set Python

🎨 Overview

This project generates animated zoom sequences into the Mandelbrot set, one of the most famous fractals in mathematics. The Mandelbrot set is defined by the iteration formula:

z_{n+1} = z_n² + c

where z starts at 0 and c is a point in the complex plane. The algorithm visualizes how different points behave under iteration, creating intricate and beautiful patterns.

✨ Features

  • Animated Zoom Sequences: Generate smooth zoom animations into beautiful regions of the Mandelbrot set
  • Rainbow Colorization: Beautiful RGB color gradients that highlight the fractal structure
  • High-Resolution Output: Generate both animated GIFs and static high-res images
  • Customizable Parameters: Adjust zoom factor, number of frames, resolution, and iteration count
  • Progress Tracking: Real-time progress indicators during generation

📋 Requirements

  • Python 3.11 or higher
  • numpy
  • matplotlib
  • pillow (PIL)

🚀 Quick Start

1. Clone the Repository

git clone <your-repository-url>
cd "Frames based UI Generator"

2. Set Up Virtual Environment

# Create virtual environment
python3 -m venv env

# Activate virtual environment
# On macOS/Linux:
source env/bin/activate

# On Windows:
# env\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Run the Generator

python art.py

📖 Usage

The script will automatically:

  1. Generate 30 frames of zooming animation
  2. Create an animated GIF showing the zoom sequence
  3. Generate a high-resolution static image of the full Mandelbrot set
  4. Save all output in the mandelbrot_frames/ directory

Output Files

  • mandelbrot_frames/mandelbrot_zoom_animation.gif - Animated zoom GIF
  • mandelbrot_frames/mandelbrot_masterpiece.png - High-resolution static image
  • mandelbrot_frames/frame_*.png - Individual frames

⚙️ Customization

You can customize the generation by modifying the parameters in art.py:

# In the main() function:

# Resolution settings
animator = MandelbrotAnimator(width=600, height=450, max_iter=80)

# Animation settings
animator.generate_zoom_sequence(
    num_frames=30,      # Number of frames
    zoom_factor=1.15    # Zoom level per frame
)

Parameters Explained

  • width/height: Resolution of each frame (default: 600x450)
  • max_iter: Maximum iteration count (higher = more detail, slower)
  • num_frames: Number of frames in the animation
  • zoom_factor: How much to zoom per frame (1.15 = 15% zoom per frame)

Changing the Zoom Region

To explore different areas of the Mandelbrot set, modify the center point in generate_zoom_sequence():

center_x, center_y = -0.7269, 0.1889  # Interesting spiral region

Try these coordinates for different beautiful regions:

  • -0.5, 0 - Main heart region
  • -0.7269, 0.1889 - Spiral region (default)
  • -0.75, 0.11 - Seahorse valley
  • -1.543, 0 - Elephant valley

🧪 Testing

Run the test suite to verify the Mandelbrot generator:

# Run all tests
python test_art.py

# Or use pytest for more detailed output
pytest test_art.py -v

The test suite includes:

  • ✅ Initialization and configuration tests
  • ✅ Mandelbrot calculation correctness
  • ✅ Color generation validation
  • ✅ Zoom sequence generation tests
  • ✅ GIF and image file creation tests
  • ✅ Mathematical correctness verification
  • ✅ Boundary condition tests

🔧 How It Works

  1. Mandelbrot Calculation: For each pixel in the complex plane, iterate the formula z = z² + c until |z| > 2 or max iterations reached
  2. Colorization: Map iteration counts to beautiful RGB gradients using sine waves
  3. Zoom Animation: Progressively zoom into a specific region over multiple frames
  4. Output Generation: Combine frames into animated GIF and save as PNG

📁 Project Structure

Frames based UI Generator/
├── art.py                 # Main Mandelbrot generator
├── test_art.py           # Test suite
├── requirements.txt       # Python dependencies
├── README.md             # This file
├── LICENSE               # MIT License
├── .gitignore           # Git ignore rules
└── env/                 # Virtual environment (not in git)

🎯 Example Output

The generator produces:

  • A smooth zooming animation showing the infinite detail of the Mandelbrot set
  • A high-resolution static image suitable for printing or wallpaper
  • Individual frames that can be used for analysis or custom animations

📝 License

This project is open source and available under the MIT License.

🤝 Contributing

Contributions are welcome! Feel free to:

  • Add new color schemes
  • Implement different fractal types (Julia sets, etc.)
  • Add interactive features
  • Improve documentation

💡 Tips

  • Faster Generation: Reduce resolution or max_iter for quicker results
  • Higher Quality: Increase resolution and max_iter for stunning details
  • Custom Zooms: Experiment with different center coordinates to discover new patterns
  • Smooth Animations: Use smaller zoom_factor values (1.1-1.2) for smoother zooms

🌟 About the Mandelbrot Set

The Mandelbrot set is named after mathematician Benoit Mandelbrot, who studied it in the 1970s. It's famous for:

  • Self-similarity at all scales
  • Infinitely detailed boundary
  • Beautiful fractal geometry
  • Connections to chaos theory

Each point in the set represents a complex number c where the iteration z = z² + c remains bounded.

📞 Support

If you encounter any issues or have questions, please open an issue on GitHub.


Enjoy exploring the infinite beauty of mathematics! 🎨✨

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages