How can I desaturate a movieclip (to black&white) using AS3?
thanks. :rambo:
How can I desaturate a movieclip (to black&white) using AS3?
thanks. :rambo:
you turn the saturation on your screen down
I highly doubt there is a way of doing photoshop stuff in flash
Maybe this might help
For black and white
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001493.html
For Sepia
http://www.reflektions.com/miniml/template_permalink.asp?id=379
[quote=blackcoma;2333504]How can I desaturate a movieclip (to black&white) using AS3?
thanks. :rambo:[/quote]
I use tweener for all that kind stuff. If you don’t know it check it out:
http://code.google.com/p/tweener/
…use special properties “colorshortcuts” and the parameter _saturation.
Its easy to implement and the documentation on the site is pretty good.
Thanks GhostDog, looks good, I’ll probably try that
Randomagain, what kind of answer is that?
You can control blur using code, so you can’t control saturation using code?
You probably found got it working by now, but this might help others.
First import the tweener and the special properties…
import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;
…then initialize the special properties:
ColorShortcuts.init();
…and then you can use it like this:
Tweener.addTween(myMovieClip, {_saturation:0, time:2});
… or however you like.
Here you have it, with tweenFilterLite you can change saturation, contrast, and brightness dynamically using one line of code:
TweenFilterLite.to(my_mc, 1, {colorMatrixFilter:{contrast:2.1, saturation:1}});
What are these shenanigans?! There is a way to change saturation via as… You just need to use a colorMatrixFilter.
var matrix:Array= new Array();
matrix = matrix.concat([1, 1, 1, 0, 0]); // red
matrix = matrix.concat([1, 1, 1, 0, 0]); // green
matrix = matrix.concat([1, 1, 1, 0, 0]); // blue
matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha
cmFilter= new ColorMatrixFilter(matrix);
var filter=new Array();
filter.splice(0,1,cmFilter);
your_mc.filters=filter;
:: Copyright KIRUPA 2024 //--