Image bleeding with water (Flash + PixelBender)

Image BleedingThe last 2 months, I’ve been investing 99% of my free time into the next iteration of Farbe, turning it into a real Flex-based image editing tool simulating natural media. Although there’s nothing of the application itself that I can show yet, today I created another small proof of concept for it that I can make public.

One of the things lacking in the watercolour POC was that once a brush stroke was made, nothing could be done with it. I thought it’d be nice to still be able to add water once the paint was rendered and have the colours bleed out. Using much of the same physics as for the watercolours, I figured out an algorithm that was both adequate in speed (real-time) as visually effective enough to water down the image. As usual, much Pixel Bender was used. The multi-threaded nature of ShaderJob really proved its worth in this case. You can keep adding water without the simulation slowing down the interaction, even if the simulation itself gets slow when there’s a lot of wet areas to cover.

To get the most realistic results, settings such as “ink speed” and “water amount” should be kept low while slowly rubbing over the image. Higher levels are not natural and will look caricatural (reminding me of Kai’s Power Tools of old! ;) ).

So check it out! :)

Note that, even tho Farbe is not an open source project (or not yet at least), I’m providing the source for this POC – consider it a late Easter present ;) But do remember, it IS poc-style code!

In closing, I’ll leave you with a few updates on Farbe. First of all, the watercolour paint is quite a bit faster (unless, of course, you’re working on much bigger canvas sizes than the cheaply upscaled old version) and so far it seems it’s pretty bug free! Secondly, I recently finished a pencil and eraser tool which are looking alright. The rest of the time has been spent mainly on the user interface and typical paint tool functionality. I’m starting to feel quite overworked at the moment, but the app is shaping up so it’s worth it! I hope I’ll be able to give out some more tangible updates on all that soon :)

8 thoughts on “Image bleeding with water (Flash + PixelBender)

  1. Pingback: .: WEREMSOFT :. » El diario del domingo - 19 de abril de 2009

  2. Wow…. you should add a slider for discoloration that would kinda darken the canvas the way real water does.

  3. Gil: I was thinking of having an option for a bleach-out effect, as is typical when adding a lot of water, but haven’t gotten around to it yet. It’s a bit tricky :-)

  4. outstanding…. i’ve been looking for something like Farbe on the App store for my iPhone. any plans to make an app out of this? for iPhone, not Android? :)

  5. Eraserheadache: No such plans at this point. I’m too focused on getting Farbe released. Perhaps a desktop mini-app (still to be announced), but nothing mobile. Definitely no iPhone app, unless Flash CS5 will perform miracles :D

Leave a Reply

Your email address will not be published. Required fields are marked *