Highlighted

using parameters in convolutionfilter

New Here ,
Dec 31, 2010

Copy link to clipboard

Copied

hi;

I want to use a convolutionfilter on a bitmap and i copied the following code:

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3, 0x80);
   this.findata.applyFilter(this.findata, findata.rect, new Point(0,0), this._emboss)

but i get an embossed gray image and i have not the colors of my image.What can i do;

i think it's a matter of alpha.

i don't understand the use of parameters:in convolutionfilter ,there are 9 parametersin the function;how can i manage if i want use only 5 parameters

as in the given example.

What are the parameters in the example?

i would write:

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3, 0x80,null,null,null,null);
or

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3,null,null,null, 0x80,null);

if 0x80 is corresponding to the color parameter

TOPICS
ActionScript

Views

388

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

using parameters in convolutionfilter

New Here ,
Dec 31, 2010

Copy link to clipboard

Copied

hi;

I want to use a convolutionfilter on a bitmap and i copied the following code:

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3, 0x80);
   this.findata.applyFilter(this.findata, findata.rect, new Point(0,0), this._emboss)

but i get an embossed gray image and i have not the colors of my image.What can i do;

i think it's a matter of alpha.

i don't understand the use of parameters:in convolutionfilter ,there are 9 parametersin the function;how can i manage if i want use only 5 parameters

as in the given example.

What are the parameters in the example?

i would write:

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3, 0x80,null,null,null,null);
or

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3,null,null,null, 0x80,null);

if 0x80 is corresponding to the color parameter

TOPICS
ActionScript

Views

389

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 31, 2010 0
Adobe Community Professional ,
Dec 31, 2010

Copy link to clipboard

Copied

if you're happy with the last 4 default parameters of the convolutionfilter constructor, you need only pass the first 5 parameters.

if you're not happy with your filter, alter some of its parameters.  the following is a good start to apply an emboss effect:

var matrix = [ -2, -1, 0,
               -1, 1, 1,
                0, 1, 2 ]

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 31, 2010 1
New Here ,
Dec 31, 2010

Copy link to clipboard

Copied

thank you for your answer but

new question:in the 4default parameters if i want to change the second: clamp to false .How can i manage?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 31, 2010 0
Adobe Community Professional ,
Dec 31, 2010

Copy link to clipboard

Copied

you must pass all parameters up to and including the last parameter you want to change from the default.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 31, 2010 1
New Here ,
Mar 14, 2020

Copy link to clipboard

Copied

 

hi;

I want to use a convolutionfilter on a bitmap and i copied the following code:

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3, 0x80);
   this.findata.applyFilter(this.findata, findata.rect, new Point(0,0), this._emboss)

but i get an embossed gray image and i have not the colors of my image.What can i do;

i think it's a matter of alpha.

i don't understand the use of parameters:in convolutionfilter ,there are 9 parametersin the function;how can i manage if i want use only 5 parameters

as in the given example.

What are the parameters in the example?

i would write:

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3, 0x80,null,null,null,null);
or

this._emboss = new ConvolutionFilter(3, 3, [
                2, 0, 0,
                0, -1, 0,
                0, 0, -1
            ], 3,null,null,null, 0x80,null);

if 0x80 is corresponding to the color parameter

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 14, 2020 0