Learn to set the Color Shift & Grayscale in the ColorMatrixFilter with ActionScript.

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Color Matrix Filter with ActionScript

 

Free Flash Tutorial


Step 6    <<   Previous      Intro   1   2   3   4   5   6   7     Next   >>       >>   Webwasp Mates

 

Step Six: Matrix Settings - Color Shift & Grayscale

If you want the amount of red in the source image to dictate the green value in the result image:

[1,0,0,0,0,   /* Red */
 1,0,0,0,0,   /* Green */
 0,0,1,0,0,   /* Blue */
 0,0,0,1,0 ]; /* Alpha Transparency */


Green is set by red value.

Here all the colors channels have been shifted to the wrong place :

[0,0,1,0,0,   /* Red */
 1,0,0,0,0,   /* Green */
 0,1,0,0,0,   /* Blue */
 0,0,0,1,0 ]; /* Alpha Transparency */


All colors have been shifter to the wrong place!


Add the blue into the red column and all color information is set by the red channel thus all colors are the same:

[1,0,0,0,0,   /* Red */
 1,0,0,0,0,   /* Green */
 1,0,0,0,0,   /* Blue */
 0,0,0,1,0 ]; /* Alpha Transparency */


All colors are set by red which gives black and white!


True Grayscale :

[.33,.33,.33,0,0,   /* Red */
 .33,.33,.33,0,0,   /* Green */
 .33,.33,.33,0,0,   /* Blue */
 0,0,0,1,0 ]; /* Alpha Transparency */


All colors are set by red which gives black and white!

         

Step 6    <<   Previous      Intro   1   2   3   4   5   6   7     Next   >>       >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

8418 visitors to this page since 2 April 07 •

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.