The code is right here.

Face to network

This project is inspired by the work made by the people of Macfang: when your mouse goes over an image, it is transformed into a network. One thing led to another, I found myself coding this exact same thing. With my coworker Charles, we've built from ground up a Python algorithm based on random geometrical graphs.

How it works

The algorithm proceeds as follows:
  1. Take the image and get the intensity of each pixel.
  2. We then choose random pixels proportionally to their intensities.
  3. We connect the chosen pixels with k closer neighbors.
  4. The network is illustrated in the most artistic manner.
In practice, we have to tweak a little bit the algorithm. First, we choose images with background and dark objects so that the chosen pixels will be located on the desired objects. Next, we add a contrast parameter which gives more weights to the intense pixel. Using this, we can see sharp dark contours like glasses and eyes.
Editorial note
In 2017, we were introduced to the designer and developer who inspired us ( See Macfang ). They told us that they have discovered that the people of Netsci were doing the same thing without referring to them. It is not clear if the people of Netsci were magically inspired but it is fair to say the people at Macfang have done a far better work.
These guys were my benchmark for the algorithm. The photos have been taken with a soft background so we don't have to premodify the image. Note the shadow drawn by the algorithm, it gives a little depth impression. Each image has roughly 20000 edges.
No animal is better suited for this network mode. Its high contrast makes it the perfect model. Credit photo unsplash-logoElijah Henderson

See on github

Programming languages and development

Network generation Image creation
C++ (winner)Gnuplot (winner)
Python (too slow to compute) D3.js (complicated to save the network)
Python (too slow for large images)