Skip to content

adammaj1/Mandelbrot-set-with-blended-gradients

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

typedef enum  {
	no = 0,
	average = 1	
		} BlendType; 

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

Basic is average

unsigned char GiveBlendedColor( double c1, double c2, BlendType Blend){

	unsigned char t;
	
	switch (Blend){
	
		case average: {t = (c1+c2)/2.0; break;}
		
		
		default: {}
	
	}
	
	return  t;


}

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:

 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

make

licence

LICENCE

git

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

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