Douwe Osinga's Blog: July 2010

Thursday, July 29, 2010

New project: Auto poster

Motivational posters pop up everywhere, either the serious ones, but really mostly at least on the internet the demotivational ones. People on all sorts of forums seem to have fun creating themselves. It's not hard - you find a powerpoint template, find an image, pick some colors, type in your funny text, create a screenshot and upload the result. Still quite a bit of work. Especially since you'll usually end up using image search to get the picture and if you want to do it right, base the color scheme on the image you use. Plus sharing by image is not as handy as sharing by url.

Auto poster does the entire thing online. You type a search string for your image, a word for the poster and your tagline and the program does the rest (i.e. fetch the image, calculate the color and project the entire thing in badly css'd html). Give it a go.

Saturday, July 17, 2010

The advance of APIs: WordColor and Landgeist are back

A while ago I had a server crash and it was really painful to restore the Zope instance I had before. I decided to do away with Zope and go with django on App Engine instead. This meant however rewriting all projects. I never really got around to that and ended up with just a subset.

Today I decided to update some, more specifically WordColor and LandGeist. It is interesting to see how much APIs have improved and how these projects can now be done a lot better.

WordColor used to be a windows executable that would screen scrape image search to get images that matched a search, average the pixel colors returned and declare the average color (with some normalization of saturation) the color of your word. That was kinda bad. If image search changed its html, the program would stop working. And anybody who had installed the program would then have to find back where it came from. But doing this online was near impossible.

Now there is a search api that lets you do image searches right from the page. You still can't access the color values from javascript of course, but a quick ajax call back to the server solves that. App engine comes with a handy images module that has a function to get the histogram of an image so that's really quick and painless now.

Landgeist was in a similar fashion a client side program that would given a word, do searches for that word and all the names of all the countries and then calculate the google share of that country for that word.

But now there is a search api callable from javascript! And you can use the chart api to update a map while you watch. The fun thing is that all the work is now just done in the browser.