Jump to content
GreenSock

gparker

ColorMatrixFilter change selected color only?

Moderator Tag

Recommended Posts

Hi,

 

I'm already using TweenMax for other things on my project so I just thought I'd see if I could use it for this too. I'm wondering if it's possible through the colorMatrixFilter or colorTransform to selectively tint only a certain color range/selection?  I'm asking this because I have a dithered (solid black and white) image I am trying to tint, and we only want to tint the black part of the image, leaving the white pixels white.  I couldn't figure any way to do it looking at the examples.

 

Basically, I want to find all of the solid black pixels and change them to the selected color, while leaving the white pixels alone.  This feature works using the colorTransform IF the image is black with the other areas have alpha transparancy, but doesn't work if the image has white instead of alpha.  So, I'm almost suspecting I'm going to have to do some kind of a selection mask for the color transform, but wanted to ask here in case there was an easier way to do it.

 

Attached is an example of how the original B&W image looks and how I want the colorized image to look.  I can achieve this effect with a Color Fill : Blend Mode: Color Dodge filter in Adobe Fireworks.post-10452-0-94520400-1359416779_thumb.gif

Link to comment
Share on other sites

In Flash you can use a "lighten" blend mode on a solid colored element that sits on a layer above your black and white image and simply tween the tint of that object.

 

 

 

TweenMax.to(mc, .5, {tint:0xff0000});
 

 

 

here is an example:

http://www.snorkl.tv/dev/blendModes/blendModes_black.html

 

CS5 Fla attached 

 

blendModes_black.zip

  • Like 1
Link to comment
Share on other sites

Thanks for the fast response and elegant solution!  You even used the cat example image, nice!  Making another layer with that blend mode is something I hadn't considered but it certainly accomplishes the effect I disired, gratitude.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×