Hi all, I recently came across NodeBox, a generative art tool
for Macs... They have a number of great functions already in the
tool, and a very impressive set of 3rd party libraries, Kuler and
Flickr included... so in a very lines of code I was able to create
compositions like this one:
Anyway, check out the rest of the set and then try out this
code in NodeBox...
web = ximport("web")
# the search string, yo!
q = "knife"
images = web.flickr.search(q, start=1, count=100,
images.sort() # sort images according to times viewed
for img in images:
print img.name, img.views
img = images
myImage = image(img.path, 0, 0, width=500, height=300)
print img.author, img.path
themes = web.kuler.search(q)
for r, g, b in themes:
#create the text objects to dump out the author names, image
names, theme names, etc.
#depending on the image returned, I alter the
"fill" colors to better suit the images or
text(img.name, 10, 275)
text(img.author, 10, 295)
text(themes.author, 10, 420)
text(themes.label, 10, 440)
#i modify the width of the them rendered to match the photo,
wasn't able to do something like image.width for some reason
themes.draw(0, 300, w=90, h=100)