After Dark

Ludivine Lechat's great artwork in the NodeBox Core Image library.

 

afterdark1

 

NodeBox source code:

coreimage = ximport("coreimage")
 
c = coreimage.canvas(500, 700)
 
images = ["1.tif", "2.tif", "3.tif", "4.tif", "5.tif"]
images_selected=[choice(images)]
images_selected.append(choice(images))
 
# The bluish radial background.
c.layer_fill(color(0.2, 0.2, 0.0))
l = c.layer_fill(color(0.8,0.8,0.4))
m = l.mask.layer_radial_gradient()
m.scale(1.5)
m.blend(30, mode="hue")
l = c.layer_fill(color(0.5,0.0,1.0))
l.blend(60, mode="hue")
l.mask.layer_linear_gradient()
 
# Draw 15 flowers.
for i in range(15):
 
    img = choice(images_selected)    
    l = c.layer(img)
    
    # It grows from the bottom.
    l.origin_bottom_center()
    l.x = i*40
    l.y = c.h + random(150)
    
    if random() > 0.5:
        l.flip_horizontal()
    
    l.rotate(-i*2)
    s = random(0.5,1.5)
    l.scale(s)
    l.blend(s)
    
    # Apply green coloring to the layer,
    l.filter_levels(r=0.5, g=0.75+random(-0.1,0.1), b=0)
    
    # Filter effects:
    # deeper contrast, coloring,
    # and random twirling,
    if random() > 0.5:
        l.filter_twirl(angle=i*100, dy=i*10)
    l.adjust_contrast(1.15)
    if random() > 0.8:
        flower = l.duplicate()
        flower.filter_kaleidoscope()
        flower.filter_levels(r=1.5)
    
    # Create a scary dropshadow.
    shadow = l.duplicate()
    shadow.filter_levels(r=0, g=0, b=0)
    shadow.filter_zoomblur(amount=10, dx=-50)
    shadow.arrange_down()
    shadow.x -= 10*s
    shadow.y -= 10*s
    shadow.opacity /= 2
    
    # Highlight part of the flower.
    light = l.duplicate()
    light.mask.layer_radial_gradient()
    light.filter_levels(r=2.5, g=1.5, b=0)
 
# The higher a flower grows,
# the more bluish it becomes (it's night).
l = c.layer_fill(color(0.5,0.0,1.0))
l.blend(40, mode="hue")
l.mask.layer_linear_gradient()
 
c.draw()