ActionScript 3.0 :: Converting Grayscale Bitmap To Alpha Bitwise Stuff

Sep 11, 2009

I've written a function that makes all white pixels in an image transparent. This works OK, but the resulting image looks jagged because it only replaces pixels that are solid white. What I'd really like to do is set the alpha value for each pixel proportional to the amount of white in that pixel, then set the RGB value to #000000. I think this would produce a very smooth semi-transparent image. However, I'm not very good at bitwise operations. Can any of you lend a hand?

As an added bonus I'd like to overlay the resulting bitmap on top of another image. I know this is possible via other means, but it would be nice to do it all in one function for performance reasons and simplicity.

[Code]...

View 7 Replies


Similar Posts:


Actionscript :: Flash - Grayscale And Alpha Mask?

Jul 9, 2011

I would like to make a mask that both converts any colors to grayscale and then reduces their alpha value. The intended purpose is for the masked region to be in grayscale and lighter so that the unmasked region is more prominent. Most tutorials I've seen for alpha value masks are far too complicated and use the Flash GUI. How do you accomplish the same thing in ActionScript?

If the following is my image:

Then a traditional mask over some selection would produce the following:Instead, those parts that are masked out completely, I would like for those to be converted to grayscale:And their alpha value decreased, so they're lightened:

View 1 Replies

ActionScript 3.0 :: Convert A Color Bitmap To Grayscale Using It?

Aug 18, 2009

How can i convert a color bitmap to grayscale using as3?

View 1 Replies

Flex :: Bitwise Operations Without Bitwise Operators?

Sep 19, 2009

Here's an example I ran across:

private function bitwiseAnd(a:int, b:int):int {
var result:int = 0;
var n:int = 1;[code]....

So basically all I need then is bitwiseOr and bitwiseNot and I'm set.The reason is that Pixel Bender doesn't support bitwise ops (inexplicably) but does support various math operations. Also they don't support loops for Flash either, but the above can just be expanded out.I thought about doing bitwise ops without bitwise operators a while back, but couldn't picture how to do it. I wouldn't know how the above was derived logically either.

View 2 Replies

ActionScript 3.0 :: Converting SWF To AVI And Output Stuff Programmatically

Sep 6, 2009

I have recently finished a test program that uses program logic to show some output, instead of doing things manually; frame by frame. I need to output the thing to an movie file but when I do File > Export > Export Movie, it does not output the stuff that are done programmatically.

View 9 Replies

ActionScript 2.0 :: Converting Something To Bitmap?

Aug 31, 2009

I made a big grid (2000x2000) and it gets pretty laggy. If my grid was a bitmap it wouldn't lag but I don't have photoshop and don't wanna remake my grid. So is there a way to convert the grid i made in flash to bitmap?

View 3 Replies

ActionScript 3.0 :: Converting Sprite To Bitmap?

Aug 11, 2008

I've got a Sprite object that I would like to extract somehow into a Bitmap object in order to manipulate certain pixels. For example, if i have a diamond shaped Sprite, I would like to convert it into a bitmap

View 3 Replies

ActionScript 3.0 :: Printing Sprites With Scrollrects Using The Bitmap Printing Option Fixes And Prints Most Of The Stuff In The Sprite

Jun 19, 2007

I have a sprite that has a scrollbar that uses the scrollrect feature. The sprite has several bitmaps and textfields. When I print the outer sprite (The one with the scrollrect) all of the textfields outside the scrollrect are cut after the first line. In case anyone else is having problems with printing sprites with scrollrects using the bitmap printing option fixes and prints most of the stuff in the sprite. Excluding all textfields outside of the scrollrect. This however can be fixed partially by embedding your fonts.

So now the only problem left is printing multiline textfields that are outside the scrollrect. P.S. Imho the scrollrect should have nothing to do with the printed area of the sprite because the printJob.addPage has a printarea parameter.

View 3 Replies

ActionScript 3.0 :: Converting Bitmap To Sprite For Animation?

May 31, 2011

/*the point of this is to add a keyboardEvent to animate the image*/I am loading a bitmap image using this function:

var myLoader : Loader = new Loader();
var myURLRequest : URLRequest = new URLRequest("thesus.png");myLoader.load(myURLRequest);
function myOnComplete(event : Event) : Bitmap{ var loader : Loader =

[code].....

View 4 Replies

Flash :: Converting A Flex Component W/images To Bitmap?

Jul 28, 2010

I am trying to take images I am placing in a flex canvas component to a bitmap. I was able to get to the point where I'm not getting an error but then no image shows up and the image I save out as a jpg is blank. I imagine I'm not setting the bitmap data correctly but can't figure out what I am doing wrong.

Here is the code where I am converting it to a bitmap:

[Code]...

View 1 Replies

ActionScript 3.0 :: Converting Textfield To Bitmap - Turns Into White Box?

Sep 22, 2009

I'm starting with a textField containing some bold white text.

If I add it to the stage directly it looks like it should look.

If I convert it to a bitmap, like this:

var bmd:BitmapData = new BitmapData(textfield.width, textfield.height);
bmd.draw(textfield);
var bm:Bitmap = new Bitmap(bmd);
addChild(bm);

Then I just get a white rectangle the same dimensions of the type.

View 2 Replies

ActionScript 3.0 :: Rotating Stuff Around Other Stuff?

Jun 29, 2011

So what I'm looking to do now is to actually get that movie clip - in this case an arrow -to rotate around another object - a ship - at a radius of 150 pixels and facing the mouse.This basically means to get the arrow to follow where the mouse goes around the ship - limited by the 150 pixel radius circle it can follow.p.s. This is the code so far:

ActionScript Code:
theArrow.x = theShip.x
theArrow.y = theShip.y

[code].....

View 4 Replies

ActionScript 3.0 :: Converting A Bitmap Loader To A MovieClip Loader?

Aug 24, 2009

how to create an image gallery that loads external bitmaps. It also has some nice fade in/fade out effects using Tweener. I was wondering, what would I need to modify from my code to load MovieClips from the library instead of the external JPEGs.

Code:
import caurina.transitions.Tweener;
var btn:Object;
var disabledBtn:Object;

[Code].....

View 8 Replies

ActionScript 2.0 :: What Are Bitwise Operators And How/why Do You Use Them?

Nov 19, 2004

i came across these things called bitwise operators. After some research i didnt get any further than the fact that they alter bits directly. Then i read something on shifting bits and stuff, and that this would be more efficient it this got me confused. Can you use them to optimize your code? Can someone give some examples of this, like a function and his alternative (using bitwise operators)?

View 6 Replies

ActionScript 2.0 :: Bitwise Is Not Working?

Oct 13, 2002

why the script in the movie as shown in the attached file bitwise.gif is not working.I have used 2 instances of buttons and a movieclip (orange box) wiht an onclipEvent( enterframe) handler. the goal was to use the movie clip to monitor if the buttons are clicked once or twice. the movie works if I use the button with (1<<0) only

View 6 Replies

ActionScript 3.0 :: What Are Bitwise Operators And How / Why To Use Them

Nov 19, 2004

i came across these things called bitwise operators. After some research i didnt get any further than the fact that they alter bits directly. Then i read something on shifting bits and stuff, and that this would be more efficient it this got me confused. Can you use them to optimize your code? Can someone give some examples of this, like a function and his alternative (using bitwise operators)?

View 9 Replies

ActionScript 3.0 :: Converting MovieClip Containing MovieClip To Bitmap?

Jan 4, 2012

If I have a MovieClip, containing several MovieClips inside, how can I convert this scene to Bitmap, without converting every element individually?

View 2 Replies

Flash :: Bitwise-shift Operations In AGAL?

Jan 18, 2012

If I encode all colors into one single float value (RGB) as:

//Each Channels are from 0 - 255
red << 16 | green << 8 | blue;

How can I retrieve those color channels back in AGAL? There doesn't seem to be any bitwise operators.

View 2 Replies

Actionscript 3 :: Number Type And Bitwise Operations

Feb 29, 2012

I want to pack epoch milliseconds into 6 bytes but i have problem. Let me introduce it:

[Code]...

View 2 Replies

Actionscript 3 :: Turn Negative Number To Positive With Bitwise Operations?

Jul 16, 2011

Is there a direct way how to turn a negative number to positive using bitwise operations in Actionscript 3? I just think I've read somewhere that it is possible and faster than using Math.abs() or multiplying by -1. Or am I wrong and it was a dream after day long learning about bytes and bitwise operations?

What I saw was that bitwise NOT almost does the trick:

// outputs: 449
trace( ~(-450) );

If anyone find this question and is interested - in 5 million iterations ~(x) + 1 is 50% faster than Math.abs(x).

View 4 Replies

Making Vector Graphic Grayscale?

Oct 5, 2009

I have a image of a cartoon (it is vector graphic created in Flash not bitmap!) and I want to change it
into grayscale, how do I do that?

View 2 Replies

ActionScript 3.0 :: Color Transform To Grayscale

Jun 11, 2009

1. Is there a function in AS3 player 9 or 10 to greyscale a Loader.load()ed jpg image? I don't even think it is feasible to manually calculate the greyscale values for each pixel. If there is no such function like photoshop does, then the other option is to have 2 images - one colored and the other greyscale - to switch between each other on mouseover. Am I right, or what else?

2. Why is it that the barbarabarry dot com images doesn't get downloaded into temporary internet files folder? I am using Loader.load to get the images loaded into flash. As a side effect, I noticed that these images gets downloaded into the temporary internet files folder (Internet Explorer). Not that it's bad, but I am curious how barbarabarry images do not get downloaded. I noticed this while trying to confirm whether the grey scale is dynamic or just 2 different images.

View 9 Replies

ActionScript 2.0 :: ColorTransformTo - Changing Image To Grayscale

Feb 20, 2007

Trying to use colorTransformTo to turn a dynamically loaded to grayscale and then back again. The rgb values are 185, 185, 185.

View 4 Replies

ActionScript 2.0 :: Convert Color Photo To Grayscale?

May 19, 2004

I have been exploring setTransform () and setRGB looking for a way to convert a color .jpg into grayscale. Even triyed using functions to define a Saturation control like the one in [URL]

View 6 Replies

ActionScript 2.0 :: Dynamic Random Grayscale Easing?

Mar 14, 2007

I'm dying here. I'm making an interactive image that's grayscale. Whenever the _parent MC is clicked, the different elements of the image randomly shift in grayscale.I have patchworked a thing together that works, but the code is so clunky that it basically kills the machine. I've tried several different color methods with varying success (can't even get colorTransform to work). how to build a function or something else that can basically shift the color to a randomly generated "target" value over n number of frames?

Code snippet:

Code:
imageHolder.onRelease = function() {
grass_color = new Color(imageHolder.grass);
oldColor = grass_color.getTransform();
//gets previous color value

[code]....

One of my big issues has been trying to create a function that can be applied to several different objects, or generate the objects for each mc. There are 5 color objects that color shift. This has been driving me nuts for days.

View 1 Replies

ActionScript 2.0 :: Change The Image Color From RGB To Grayscale?

May 9, 2005

can i change the image color from RGB to Grayscale in flash mx 2004 with Action script

View 5 Replies

ActionScript 3.0 :: Manipulate Saturation / Make Movieclip Grayscale?

Aug 20, 2009

in the filters panel, there is an "adjust color" option.. and inside of it, there is an option there for "saturation".. setting it to the lowest (-100) will turn the movieclip / whatever object you're applying the filter to, to grayscale..i was wondering, how would i go about this using code?

for example, if there was a movieclip on stage called "thePic" and i wanted to decrease its saturation slowly every enterframe until it finally becomes grayscale, how would i go about it?i know how to manipulate the other filters like GlowFilter and BlurFilter through code, but it seems like there is no "AdjustColorFilter".. there is a ColorMatrixFilter, but i dont event understand how it works..

View 2 Replies

ActionScript 2.0 :: Change The Image Color From RGB To Grayscale In Flash Mx 2004?

May 9, 2005

can i change the image color from RGB to Grayscale in flash mx 2004 with Action script

View 5 Replies

ActionScript 3.0 :: Setting The Alpha Of MovieClip With Objects Changes The Alpha Separately For Each Object

Oct 23, 2010

[URL] i want the object to fade out but in the object there's a lot of overlapping pictures and each becomes half transparent. how to make the movieclip to change the alpha as it was without objects?

[Code]....

View 2 Replies

ActionScript 3.0 :: Curious Tip: Flipping Sprite.alpha=0 To Alpha=1 Back And Forth With No Logic?

Dec 15, 2011

just spotted this curious trick. If you want to flip something to go invisible on a click, and then reappear on another click (etc etc), try this:

create the sprite, setting alpha to either to 1 OR -1
mySprite.alpha=1; //OR
mySprite.aplha=-1;

[code]....

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved