>>
There is probably a quicker way of mapping the values from a grayscale image
to colour values, so have a scout around - maybe play with FlashFilterLab,
but I am guessing the ColourMatrix filter may help again here...
>>

I think once you get your gradient data into a R,G & B array, you do have a
faster way to apply the mapping, without a bunch of setPixel / getPixel
calls. You could use the paletteMap method and pass the grayscale as the
source, and the gradient data for the R,G & B channels.

Cheers
Juan Pablo Califano

2008/11/10, Glen Pike <[EMAIL PROTECTED]>:
>
> Hi,
>
>   From what I can see of the gradient map, it multiplies a grayscale value
> by a gradient??
>     To do this, you need to get your bitmap data into grayscale - use the
> ColorMatrixFilter like here:
>
>   http://www.actionscript.org/forums/showthread.php3?p=766173
>
>   Then you will need to map your grayscale values to a colour value.  I
> guess one way to do this would be to create a 1 * 256 rectangle filled with
> a gradient of your choice.  You would then convert this to a bitmap, then
> map the value of each pixel in your image you want to gradient map to the
> RBG value of the corresponding pixel in your 256 long rectangle:
>
>     e.g.
>   //convert bitmap data to grayscale using the above method,
>   //pseudocode - you would probably need to call getPixel / setPixel and
> other methods...
>   mapped = new Bitmap(grayscaleW, grayscaleH);
>   for(each pixel in grayscale) {
>       var luminance = grayscale[x][y].red;  //0-255 could use .green or
> .blue as they are all the same value
>       mapped[x][y] = gradientRBG[luminance];
>   }
>
>   //This means you could use any gradient you want and create it
> dynamically, or create it at authortime as long as it is 1 x 256 (you can
> make it larger, but you just sample the pixel RGB values from the first row.
>
>   There is probably a quicker way of mapping the values from a grayscale
> image to colour values, so have a scout around - maybe play with
> FlashFilterLab, but I am guessing the ColourMatrix filter may help again
> here...
>
>   HTH
>
>   Glen
>
> ACE Flash wrote:
>
>> any suggestions? please...
>>
>> On Mon, Nov 10, 2008 at 11:36 AM, ACE Flash <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> Hey there, I am going to apply the gradient map effect on a image ( the
>>> name called in photoshop => image => ajustments => gradient map ) . do
>>> you
>>> know how to deal with it in action script 3?
>>> *http://yarra.ath.cx/zmzm/upload/Picture_1.png*<
>>> http://yarra.ath.cx/upload/Picture_1.png>
>>>
>>>
>>> Thank you
>>>
>>>
>>>
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>
>>
>>
>
> --
>
> Glen Pike
> 01326 218440
> www.glenpike.co.uk <http://www.glenpike.co.uk>
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to