Skip to content

Instantly share code, notes, and snippets.

View njanakiev's full-sized avatar

Nikolai njanakiev

View GitHub Profile
@njanakiev
njanakiev / fractal.py
Created November 9, 2017 12:23
Mandelbrot and Julia Set with PIL
import numpy as np
from PIL import Image
output_image = 'fractal.png'
def evalMandelbrot(x, y, n=20):
c = x + 1j*y
out, count = 0, 0
for i in range(n):
if abs(out) <= 2:
@njanakiev
njanakiev / combine_images.py
Created March 30, 2017 08:40
Resize and combine images to an n by n grid with ImageMagick commands: morgify and convert
import os
import shutil
# Settings
n, m = 6, 6
input_folder = "input"
tmp_folder = "tmp"
output_image = "combined_image.png"
size = 300