views:

772

answers:

2

I want to implement various effects like Sepia, GrayScale, Posterization etc. on BitmapData in ActionScript-3.

How to do this and What is most efficient way to do this ?

Thanks in advance!!

A: 

This post explains how to do the GrayScale:

http://stackoverflow.com/questions/1098890/as3how-to-change-a-colored-bitmaps-bitmapdata-to-black-and-white

Sepia is a combination of grayscale and tinting. Tinting is typically accomplished by multiplying one of the colour channels by a certain amount to boost that colour.

The techniques illustrated in that post are the way you should proceed. You'll have to look up the per-pixel filtering algorithms, but many of them exist on wikipedia or math sites.

Soviut
A: 

The most efficient way to do image processing would be to use Adobe Pixel Bender. This is basically a pixel shader like language that can be used to create filters for Photoshop, After Effects and Flash. There is also an exchange where developers share filters.

Here is a tutorial on how to load pixel bender filter into flash.

There is more information available if you search Google for "pixel bender flash".

James Fassett