l'essentiel est invisible pour les yeux

Friday, February 15, 2008

as3filters: Variety of filters for image processing

I think DisplacementMapFilter is pretty cool, but this is a little difficult. So I have created pack of DisplacementMapFilter for variety of effects. We'd like to use DisplacementMapFilter easily to apply interesting effects to the image. If you have interesting idea or skill, please e-mail to rakuto@gmail.com.


I have created Demo application for as3filters. If you are Mac OSX user then you know Photo Booth application, don't you? Photo Booth is simple application to take picture and apply some effects. This one is pretty simple, but intrestin. So I created application with Flash like Photo Booth.

as3filters - Photo Booth Demo

You need to enable the web camera to run the demo. If you don't have web camera then see snapshot.
Snapshot of Photo Booth DEMO

Please see as3filters for details.

% svn checkout http://as3filters.googlecode.com/svn/trunk/ as3filters
% cp as3filters/bin/as3filters.swc /path/to/your-project
% mxmlc -compiler.include-libraries as3filters.swc

How to apply the filters

var bmd:BitmapData = new BitmapData(width, height, true);
var region:Rectangle = new Rectangle(30, 30, 90, 90)
var twirlFilter:DisplacementMapFilter = Filter.twirlFilter(bmd, region);
bmd.applyFilter(bmd, bmd.rect, new Point(0, 0), twirlFilter);

What kinds of filter can I apply?
Currently, there are few filters. We'd like to contribute the as3filters project.
  • Twirl
  • Pinch
  • Fisheye
  • Mirror
  • Photic tunnel
  • Bulge
  • Squeeze
  • Strech

Maybe you found dent filter is invalid. I don't know SphereFilter alogorithm. Someone tell me SphereFilter algorithm please.