How to do a Replace a Range of colors using AS3?

1k views Asked by At

I want to reproduce Photoshop's Replace Color feature in AS3.

Here is what i want to achieve on 8-bit images:

http://www.digital-photography-school.com/wp-content/uploads/2009/07/before-after.jpg

I want the user to be able to :

1 - select a color using an 'eyedropper'
2 - select a threshold ( example : http://cl.ly/3J3Q1f1M242E2Q1z0F25 )
3 - select a replacement color

  • it is important that the color replacement blends well and does not have banding/dithering.

any code and examples would be greatly appreciated.

2

There are 2 answers

2
Igor K. On

This should get you started. It's a little tough to get into, but once you get the hand of things it becomes a real time-saver.

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS3E659D01-10C0-479d-8175-B40950BBC223.html

0
Quasimondo On

There is a demo and source code for a selective color transform on my site which I think is doing exactly what you are looking for - the only issue is that since the post is from 2006 it's still in AS2, but the core part is pretty much the same in AS3:

http://www.quasimondo.com/archives/000614.php