项目作者: adammaj1

项目描述 :
Mandelbrot set with blended gradients
高级语言: C
项目地址: git://github.com/adammaj1/Mandelbrot-set-with-blended-gradients.git
创建时间: 2021-01-10T17:13:48Z
项目社区:https://github.com/adammaj1/Mandelbrot-set-with-blended-gradients

开源协议:GNU General Public License v3.0

下载


How to use blend modes to make better images ( of Mandelbrot sets and …)
These images are inspired by great technique used by Adam Saka in KFMovieMaker and his videos

Results: A picture is worth a thousand words




Algorithm

Blend modes

Blend types (= modes) definition

  1. typedef enum {
  2. no = 0,
  3. average = 1
  4. } BlendType;

How to compute blended color from 2 input colors ? Here color is a single number (shades of gray)

Basic is average

  1. unsigned char GiveBlendedColor( double c1, double c2, BlendType Blend){
  2. unsigned char t;
  3. switch (Blend){
  4. case average: {t = (c1+c2)/2.0; break;}
  5. default: {}
  6. }
  7. return t;
  8. }

There are many blend modes

potential (Linear step) plus slope

Here exterior of the Mandelbrot set is:

  • described by potential
  • coloured with 1D gray gradients

Interior is solid colour blue

First image is slope ( normal map = Lambert reflection (Illumination model or shader )

Second image:


3-rd image = Result of blending above images in average mode

Potential ( sqrt step ) + slope

First image is the same as above = ( normal map = Lambert reflection (Illumination model or shader )

Second image:

  1. p = 1.0 - p;


3-rd image = Result of blending above images in average mode

see also

program

c console program for creating static images (png)

dependencies

  • bash
  • gcc
  • GNU Make
  • OpenMP
  • Image Magic convert ( from ppm to png )

to run

  1. make

licence

LICENCE

git

  1. git init
  2. git add README.md
  3. git commit -m "first commit"
  4. git branch -M main
  5. git remote add origin git@github.com:adammaj1/Mandelbrot-set-with-blended-gradients.git
  6. git push -u origin main

local repo: ~/Mandelbrot-set-with-blended-gradients