Illustrating with Python + Processing

Nick Kunz
Data Mining the City
2 min readSep 20, 2017

This was my first time experimenting with Python + Processing as an illustration tool. I had a great time with this project! I found that I was able to draw lines and specify curves more effectively through a generated list of reference points. Exhibited above is the output and below is the source code.

# axis references (not used for control points in curve)
axislist = [100, 200, 300, 400, 500, 600, 700, 800]
# environment
size(axislist[7], axislist[4])
background(255)
# line weights
extra_heavy = 3
heavy = 2
light = 1
# curve syntax
# curve(x1, y1, x2, y2, x3, y3, x4, y4)
# x1 coordinates for the beginning control point
# y1 coordinates for the beginning control point
# x2 coordinates for the first point
# y2 coordinates for the first point
# x3 coordinates for the second point
# y3 coordinates for the second point
# x4 coordinates for the ending control point
# y4 coordinates for the ending control point
# right eyebrow
strokeWeight(heavy)
noFill()
stroke(0)
curve(0, 400, axislist[3], axislist[1], axislist[4], 185, 500, 200)
# left eyebrow
strokeWeight(heavy)
noFill()
stroke(0)
curve(565, 290, 360, 203, axislist[2], 205, 310, 210)
# right eyeball
strokeWeight(heavy)
noFill()
stroke(0)
curve(200, 410, 409, 219, 487, 212, 492, 200)
strokeWeight(light)
noFill()
stroke(0)
curve(400, 200, 409, 219, 487, 212, 700, 90)
# left eyeball
strokeWeight(heavy)
noFill()
stroke(0)
curve(515, 300, 360, 220, 310, 218, 350, 210)
strokeWeight(light)
noFill()
stroke(0)
curve(360, 220, 360, 220, 310, 218, 190, 125)
# nose
strokeWeight(light)
noFill()
stroke(0)
curve(445, 0, 372, 260, axislist[3], 280, 300, 318)
# mouth
strokeWeight(light)
noFill()
stroke(0)
curve(370, 310, 365, 305, 425, 297, 600, 160)
strokeWeight(light)
noFill()
stroke(0)
curve(370, 310, 365, 305, 425, 297, 600, 230)
strokeWeight(light)
noFill()
stroke(0)
curve(360, 310, 365, 305, 425, 297, 600, 100)
strokeWeight(light)
noFill()
stroke(0)
curve(360, 310, 365, 305, 425, 297, 565, -50)
# silhouette
strokeWeight(light)
noFill()
stroke(0)
curve(390, 300, 370, 330, 435, 330, 640, 130)
strokeWeight(light)
noFill()
stroke(0)
curve(350, -95, 295, 195, 370, 330, 400, 350)
strokeWeight(light)
noFill()
stroke(0)
curve(340, 410, 435, 330, 490, 270, 590, 150)
strokeWeight(light)
noFill()
stroke(0)
curve(340, 410, 490, 270, 510, 170, 495, 150)
#hair
strokeWeight(light)
noFill()
stroke(0)
curve(-900, 390, 385, 90, axislist[4], 450, 600, 600)
strokeWeight(light)
noFill()
stroke(0)
curve(-500, 405, 385, 95, 505, 450, 600, 600)
strokeWeight(light)
noFill()
stroke(0)
curve(-1300, 405, 385, 85, 535, 450, 1000, 600)
strokeWeight(light)
noFill()
stroke(0)
curve(-800, 405, 389, 80, 550, 410, 400, 400)
strokeWeight(light)
noFill()
stroke(0)
curve(1200, 390, 370, 90, axislist[2], 425, 600, 600)
strokeWeight(light)
noFill()
stroke(0)
curve(800, 390, 370, 95, 250, axislist[3], 300, 600)
strokeWeight(light)
noFill()
stroke(0)
curve(1200, 390, 370, 85, axislist[2], 440, 50, 600)
# neck
strokeWeight(light)
noFill()
stroke(0)
curve(250, 300, 348, 305, 365, axislist[3], 300, 425)
strokeWeight(light)
noFill()
stroke(0)
curve(500, 305, 460, 305, 460, axislist[3], 500, 550)

--

--