Tuesday, November 10, 2009

Image Posterization

Last night I decided to change my wallpaper. I usually keep something for a really long time on there that I absolutely love. So every now and then I need to keep it fresh. I settled on a cell shaded render of Master Chief from Halo 3 and that got my interested in making my own. My friend Jake is the Jesus of non photo-realistic rendering (NPR) so I set out to get some answers. (Side note: you can check out his work here)

It turns out that 2D image's aren't really turned in to cell shaded, that's more a 3D approach. Perhaps I should have listened more when Jake added cell shading to our ray tracer last year, but that's how it goes, I never listen to anyone. What I was looking for if anything at all was called posterization.

So I checked out the wiki page, I did a Google search and finally got a complete idea of how it's done. Then, I quickly hammered together a little C# application which implements the posterization algorithm.

Here are my results. In honor of Jake, I used his picture, I'm sure he'll be mad, but that's the point. The slider parameter controls how many areas of colors are to be seen. As far as I can tell it looks identical to Photoshop's Posterize filter.


Iif I can figure out how to upload files to Blogger I'll share the source code with everyone. It's really quite simple. But now, on to better things, like coffee and wedding photographers.

0 comments:

Post a Comment