Sha256: f540336f87168525e883766538d93b24de9e3f0a77d4c65d90c64c8956a135df
Contents?: true
Size: 483 Bytes
Versions: 10
Compression:
Stored size: 483 Bytes
Contents
# Pointillism # by Daniel Shiffman. # # Mouse horizontal location controls size of dots. # Creates a simple pointillist effect using ellipses colored # according to pixels in an image. def setup size 400, 400 @a = load_image "eames.jpg" no_stroke background 255 smooth end def draw pointillize = map(mouse_x, 0, width, 2, 18) x, y = rand(@a.width), rand(@a.height) pixel = @a.get(x, y) fill pixel, 126 ellipse x * 2, y * 2, pointillize, pointillize end
Version data entries
10 entries across 10 versions & 1 rubygems