diff --git a/Mandelbrot.py b/Mandelbrot.py index 16eb106..c6c69df 100644 --- a/Mandelbrot.py +++ b/Mandelbrot.py @@ -8,14 +8,14 @@ def mandelbrot (c, max_iter): z = z*z + c return max_iter -width = 600 -height = 800 +width = 800 +height = 600 img = Image.new('RGB', (width, height)) # die komplexe Ebene definieren x_min, x_max = -2 , 1 -y_min, y_max = -1.5, 1.5 +y_min, y_max = -1.2, 1.2 for x in range(width): for y in range(height): @@ -24,4 +24,17 @@ for x in range(width): c = complex(real, imag) print ("x-> ", x, " y-> ", y, " -> ",c) + m = mandelbrot(c, 100) + + # Einfache Farbgebung: Schwarz für die Menge, Blau-Töne für den Rand + if m == 100: + color = (0, 0, 0) + else: + color = (0, 0, m * 2 % 255) # Blau-Gradient + + img.putpixel((x, y), color) + + img.save("mandelbrot.png") + print("Bild wurde als mandelbrot.png gespeichert!") + diff --git a/mandelbrot.png b/mandelbrot.png new file mode 100644 index 0000000..e2b0c4b Binary files /dev/null and b/mandelbrot.png differ