Home

Awesome

node-annulus-bot

Meet @AnnulusBot, my first attempt at a #generativeart bot on Twitter!

How Does It Work?

AnnulusBot generates sequences of annulur segments, with random thicknesses and spacings of the radial and angulur components. It also uses the top 1000 color palettes from Colour Lovers (provided in JSON format by the Jam3/nice-color-palettes repo). There are 8 settings that get randomized, either during the initial startup or during the sequenced, radial buildout of the annulur sectors.

Built with Node.js and deployed using AWS Lambda/CloudWatch, AnnulusBot is very similar to my other two Twitter bots, BrokenArrowBot and CupolaBot.

Any Issues?

While all three of these bots do image generation, the other two bots used the Jimp Node.js library to do PNG manipulation. For the AnnulusBot, I decided to use SVG to make the annulur segment manipulations a little easier.

But! I ran into a bit of a problem trying to export the SVG image to PNG. I used the svg2png Node.js library, which uses "the latest in PhantomJS technology to render your SVGs using a headless WebKit instance." The only problem is that it didn't want to run in AWS Lambda! Long story short, I came across a roundabout solution that consisted of running <code>npm install</code> in a Docker/Linux instance using these bash commands. This apparently builds a Linux version of PhantomJS in the Node.js project, which plays nice with Lambda. And it worked!