Monday, March 19, 2012


Pixel Art

Lately I've been obsessed with this image.

It was generated using an iPhone app called pxl. When I saw this particular image, I was inspired to take one of our photos and create a large poster we can put on the wall. However, after some investigation, we discovered that the output of the app is limited, and a high resolution image that would be appropriate for large scale printing was not available.

I still wanted to create some wall art in this style. I tested with upscaling with Photoshop, and after applying several noise-reduction and sharpening filters, I came up with a reasonable output quality, but it wasn't very satisfactory. Another option was to create a file from scratch using Adobe Illustrator, but that quickly turned out to be much more time consuming than it was worth. What to do...?

Then I thought about using some sort of coding/scripting language. The version of Photoshop that I have doesn't support scripting, so that was out. Perhaps this was a motivation to learn python? But that would take a while, and I don't have that much free time. Then I remembered a scientific imaging program that many researchers already use with powerful built-in scripting: ImageJ. I quickly looked up the documentation for scripting and I was off. In a few hours I created something that did what I wanted. Once I set the bar width, bar height, and spacing between bars, the script calculated the mean RGB values for pixels in a regularly spaced array, and then painted an angled rectangle in a new blank image with that RGB value. After the new image was constructed, a "smooth" filter was applied twice.

Here are a couple examples. The first is a photo of ducklings that hatched last year near my building:

The second is a photo of Archie on Galveston Beach: