Coder Social home page Coder Social logo

c_mandelbrot's Introduction

C Mandelbrot

Overview

The C_Mandelbrot project is a C program for generating Mandelbrot fractal images. The program provides flexibility in rendering Mandelbrot sets with various color schemes and visualization options. It allows users to customize the rendering parameters such as maximum iterations, camera position, image dimensions, and output file basename.

Table of Contents

Compilation

To compile the program, use the following commands:

gcc -W -Wall -ansi -pedantic -c colors.c
gcc -W -Wall -ansi -pedantic -c mandel.c
gcc -W -Wall -ansi -pedantic colors.o mandel.o -o mandel -lm

Usage

The program takes command-line arguments for customization. The basic usage is as follows:

./mandel [max_iter] [cam_x,cam_y,cam_w,cam_h] [img_widthximg_height] [basename]
  • max_iter: Maximum number of iterations for the Mandelbrot set calculations.
  • cam_x,cam_y,cam_w,cam_h: Camera position and dimensions (coordinates and width/height).
  • img_widthximg_height: Image dimensions in width x height format.
  • basename: Basename for the output files.

Configuration

Alternatively, users can provide a configuration file with the desired parameters. An example configuration file might look like this:

output_image
1000x1000
rgb
-0.76,0,2.48,2.48
100
2

To use a configuration file, pass its path as the first command-line argument:

./mandel config.txt

Output Types

The program supports various output types, which can be specified in the configuration or command-line arguments:

  • rgb: Color image (default)
  • b&w: Black and white image
  • b&w_alt: Alternating black and white
  • grey_stepped: Grey levels with stepped interpolation
  • grey_smoothed: Smoothed grey levels

Examples

Example 1

Generate a default Mandelbrot image with 1000 iterations, a default camera position, and dimensions of 1000x1000 pixels. Save the output with the basename "mandel".

./mandel 1000 -0.76,0,2.48,2.48 1000x1000 output_image

Example 2

Generate a Mandelbrot image using a configuration file named "config.txt".

./mandel config.txt

License

This project is licensed under the MIT License. Feel free to use and modify according to your needs.

c_mandelbrot's People

Contributors

liamlatour avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.