newklearblog

Home of the mighty Benjamin “Adolphus Ricardo Jesus Quintin Calmelita Def” Alldridge

Pollack-0.2b

Pollack is the result of a bored Saturday morning, and me wanting to generate random art. Inspired by the famous Abstract artist, Jackson Pollock, that’s where the name comes from. The “misspelling” is borne of the fact that it’s an art generator, and thus the o gets replaced with an a.

Never having experimented with the GD library to any real extent before (aside from my stat counter I built for myspace), I figured I’d try my hand at building a randomly-generated art program from GD which accepted three numeric variables: X-height, Y-height, and a “salt”. This allows the overall output size to be set, as well as the random generations to be controlled to some degree. Everything is controlled by random variables; colours, positions and element sizes all being treated to this. The only real “roofed” element in any of the calculations is the amount of output elements which will be produced, it ranges from between 15 and 491 iterations. It will then go through and output a loop for the amount of iterations generated.

From there, the magic is done: it gets output with the content-type “image/png“, the type of choice for this type of image. This ensures file sizes stay down, and server load is minimal. Finally, the image is destroyed from the server’s memory, and passed to the user’s browser.

This is how it looks in action (with all three variables set):

Go have a look at the source if you’re interested.

Malarkey

There are no responses. Respond.

Trackback

fuelled by newklearsyndicate
Copyright © Benjamin Alldridge, 2008. Powered by Wordpress, and fuelled by newklearsyndicate. | top?