Michael Fogleman

Projects AboutResumeMore

Projects tagged "2d"

This page highlights several of my personal software projects.

Table of Contents


Physarum Simulation November 2020

850 Go 2D Generative Graphics

Particle-based simulation of slime molds.

Inspired by Sage Jenson's article on simulating the Physarum polycephalum slime mold. The algorithm is surprisingly simple, given how complex its outputs appear. That's the magic of generative algorithms! There are several configurable parameters, which are randomized for each run. This would be a great candidate for running on the GPU, but my implementation is purely CPU-based and written in Go. There is an OpenGL-based viewer, however, so you can watch the simulation as it runs. A lot more could be done here... food sources, life & death, evolution, etc.


DLA February 2019

183 C++ Generative 2D 3D

Fast diffusion-limited aggregation in both 2D and 3D.

This is a small program that generates diffusion-limited aggregations in either 2D or 3D. The output is a CSV file containing the coordinates of the particles and their relationship to one another. Rendering is out of scope, but I have produced several example renders. The code is very configurable - there are a few parameters that you can tweak and there are also several code hooks that allow you to alter the algorithm's behavior.


Domain Coloring March 2018

50 Go 2D Graphics

Visualize complex functions by coloring each point in the complex plane.

This was a quick experiment inspired by 3Blue1Brown's video called How to solve 2D equations using color. The colorings are based on the magnitude and/or phase of the complex numbers transformed by a function. The coloring algorithm can be as simple or as complicated as you can imagine, providing plenty of room for creativity.


Primitive September 2016

12,346 Go Objective-C 2D Vector Graphics Optimization

Recreate your photos with vector-based geometric primitives.

You provide an image as input. The app tries to find the most optimal shape that can be drawn to maximize the similarity between the target image and the drawn image. It repeats this process, adding one shape at a time. Using this process, the program can recreate a photo with surprisingly few shapes.

This project was originally inspired by the popular and excellent work of Roger Johansson - Genetic Programming: Evolution of Mona Lisa. Since seeing that article when it was quite new, I've tinkered with this problem here and there over the years. But only now am I satisfied with my results.

The core is written in Go and is open source. A native macOS app is also available in the App Store, providing a nice UI on top of the engine as well as some additional features like "drawing mode." To date, this has been my most successful paid app.


Go Graphics February 2016

4,284 Go 2D Graphics

Cairo-inspired 2D graphics library written in pure Go.

Go has an excellent set of image packages, but what do you do when you want to render 2D graphics? The golang freetype library implements nice anti-aliased rendering of paths, but is primarily for drawing text. So I built gg on top of it to provide a nice, general purpose 2D graphics API inspired by Cairo.

Features

  • Anti-aliased rendering
  • Fill and stroke paths
  • Draw images and text
  • Built-in word wrapping
  • Line caps, joins, dashes
  • Gradients and patterns
  • Transformation matrix
  • Push and pop context state
  • Clipping regions

Pirate Maps December 2015

261 Python Cairo 2D Graphics Maps

Procedurally generated pirate treasure maps. X marks the spot!

This was my submission in the /r/proceduralgeneration monthly challenge. I used several excellent third party libraries...

  • cairo for rendering
  • colour for color interpolation
  • noise for simplex noise
  • Pillow for saving debug images of noise layers
  • pyhull for delaunay triangulation
  • Shapely for all kinds of 2D geometry operations

Tiling June 2014

480 Python 2D Graphics

Quickly construct tilings of regular polygons and their dual tilings using a simple API.

This code provides an interesting API for constructing tilings of regular polygons. It can also render the dual tilings.


AllRGB March 2014

61 Python C 2D Graphics

Generate images that use all 16,777,216 RGB colors exactly once.

Efficiently create AllRGB images that target an input image. The input must be 4096x4096px. The output will also be 4096x4096px and will contain all 16,777,216 distinct RGB values once and only once.

See allrgb.com for details on the concept.

Read more...


Scale March 2014

40 Objective-C 2D

Beautiful fractals for macOS.

Explore the mathematical beauty of fractals and create stunning fractal art with Scale. Scale is fast and a pleasure to use. It was designed from the ground up to be intuitive and user-friendly.


Piet September 2013

97 Python 2D

Procedurally generating Images in the style of Piet Mondrian.

Piet Mondrian was a Dutch painter. His paintings with orthogonal lines and rectangular splashes of primary colors on white backgrounds are very recognizable. I wondered what it would take to programmatically generate Mondrian-esque images. Here's what I came up with.