Playing with Impressionism - Emulating Painting in ActionScript


I have thoroughly been enjoying messing with my wife’s lovely photos the last couple of days. Her studies in the spring flora have inspired me to try to manipulate them to look like some of her favorite painters. Manet, Monet, Degas, Cassatt… on and on. I personally am an abstract expressionism fan, Klee, Kandinsky, etc., but I thought it might be fun to see what I could do with a minimal amount of code and some great source images. While certainly not a complete study, they are at least a nice diversion from some other work I have been doing lately. Read on to see more.

The basic premise of these pieces are as such… Load a bitmap, select a pixel, sample it’s color. Chose a pixel offset from that original by a number within a set range. Repeat a third time and then draw a variant weight lineGradientStyle colored line using that created gradient from the origin point to the final point sampled. After that’s complete, blur it, cache it as a bitmap and put it on stage. We do this about 15,000 times using a timer to produce an image.

To add to the feel, I mix up the sample areas and the overall “accuracy” of the sample by choosing a angle for the line within a narrow range and seeding a few of the gradients with slightly off-kilter color information by sampling a neighbor of the pixel rather than the true color that should actually be sampled for that mid-tone. This creates a little more personality in the gradient blends and helps to avoid a bit of the mechanized look. The three tone gradient also helps with this effect.

Take a look at some early results.

Lilac
Lilacs 4/29
Japanese Maple
Japanese Maple
I will be working some enhancements to this like using color variance between sample regions to affect stroke size and direction. This should serve to greatly enhance the painterly effect of it, increase the fidelity of the rendering and really really punch up the detail level. I also will be trying out some animation techniques to make the render a little more exciting than watching paint dry. Currently, it simply applies a strip at a time, one every 10 microseconds. Source code will be coming, too, but not until it’s cleaned up a bit more. What do you think? As always, I welcome thoughts and critiques.

Posted on


3 comments

  1. Darren Daz Cox May 6

    i think it would be excellent if you could take it from the static image world to something that moves perhaps randomly or changes the way light and shadows do in nature.

  2. Chad May 6

    Darren, that’s a great idea. Thansk for the feedback.

  1. Progress with Painting. We Have Edge Detection. | Visualrinse | Design and Development by Chad Udell

Leave a reply

Related Posts:

  • Progress with Painting. We Have Edge Detection.
  • Taking the weekend off…
  • Yay, Flash Player Beta 10 2 - My Favorite Feature “unloadAndStop”