Making a book
-
My friends and I are making a book. We'd like to take an animation and seperate it out, frame for frame, into at least 300dpi SVGs. Been trying to figure it out in Processing without much luck. Here is the link to the sketches we're working off of:https://www.openprocessing.org/sketch/632896
Would it be possible to achieve this with Drawbot? If so, how?
Thanks!
-
yes, this is possible. in DrawBot a page and an animation frame are essentially the same thing.
here’s a simple example:
def drawShape(step): '''A function to draw a shape based on the current page/frame number.''' translate(40, 40) stroke(1, 0, 0) fill(None) for i in range(step): rect(0, 0, 100, 80) translate(10, 10) # create pages/frames for i in range(20): newPage(400, 400) drawShape(i+1) # save animation saveImage('test.gif') # save book saveImage('test.pdf')
-
@gferreira thank you!!! do you know how i might make images high res? sorry if this is obvious. pretty new to this.
-
@Patricia the canvas size is defined in points using size() or newPage(). the default output resolution for raster images is 72 dpi (1pt = 1px), you can set another value with saveImage():
saveImage('test.gif', imageResolution=300)
good luck!
-
@gferreira Thanks so much!