Pages

Wednesday 26 May 2010

Wet Paint Mixing in Flash

One of my favourite features on Photoshop CS5, is the wet mixer brush, which is almost like a real paintbrush to use. I decided that if photoshop could do it, so could I, and a started to work on writing some actionscript that would handle the job.

The basic idea is that a brush is made up of bristles. When you press down on the screen each bristle picks up a certain amount of paint from the pixel it is currently over, and then as you drag your brush around, each bristle drags paint around underneath it.

To do this I wrote some actionscript that found the colour under each bristle, mixed the paint that was already on the bristle with the new paint underneath it, and then moved that new colour to the new location of the bristle. The program draws the paint stroke onto a new layer, a kind of buffer, which it then blurs (for added realism) and copies back onto the original painting.

Here are a few initial results:

Original Image















Painted version:















And here are a few more examples of another image created with it. I'm actually getting similar results as with the photoshop brushes which I'm quite pleased about. To launch the application simply click here and give it a go for yourself. Let me know what you think!









2 comments:

  1. i think this is really good!
    Thanks for sharing!

    ReplyDelete
  2. Hi Mathieu,

    Glad you like it! Personally I think the self painting version ( http://experimentalized.blogspot.com/2010/05/self-painting-images-in-flash.html ) is better. I definitely like the unpredictable nature of it.

    Sam

    ReplyDelete