Skip to content

Instantly share code, notes, and snippets.

@typemytype
Last active June 3, 2017 00:46
Show Gist options
  • Select an option

  • Save typemytype/b41766123f4cb081a332eeaf72486440 to your computer and use it in GitHub Desktop.

Select an option

Save typemytype/b41766123f4cb081a332eeaf72486440 to your computer and use it in GitHub Desktop.
ad for painting in drawBot
amount = 10
s = 20
dotInset = 4
im = ImageObject()
path = BezierPath()
path.moveTo((0, 0))
path.lineTo((0, s))
path.lineTo((s, s))
path.closePath()
path.oval(dotInset, dotInset, s-dotInset*2, s-dotInset*2)
with im:
size(s*amount, s*amount)
for x in range(amount):
for y in range(amount):
save()
translate(x*s, y*s)
drawPath(path)
restore()
im.pinchDistortion(
center=(80, 120),
radius=250,
scale=0.15)
im.twirlDistortion(
center=(s*amount*.5, s*amount*.5),
radius=110,
angle=20)
size(s*amount, s*amount)
image(im, im.offset())
saveImage("adForPainting.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment