0
votes

I want to decrease an 480 X 480 bitmap image size to 30 X 30 pixel size but keeping the whole height and width intact. (I do not want to scale or use height/width property! )

So if i divide 480/16 = 30. So i need to take average pixel values of 30 pixel elements and put it into new image.

How to take the average in actionscript 3.0? I looked at getpixels() method, is their any simple way/methods to achieve this?

Let me put in more simple way - I am trying to reduce pixels in an bitmap image from 480 X 480 to 30 X 30, the height and width remain same and i expect some amount of distortion after converting image to 30 X 30.

I did scaling but it reduces width and height, if i again increase width and height it just regains normal pixels. Thanks!

1
I think you want to look into doing a MatrixTransform on the image to resize it: livedocs.adobe.com/flex/3/html/… help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/…JeffryHouser
Is there any reason why you don't want to rescale? If you set smoothing=true on the Bitmap (or Image.content, when it finishes loading) it should have a very similar effect. Another possible course of action: use a seperate thumbnail image.primo
Do you mean your image as 30x30 in a 480x480 bitmap?Jason Sturges
yes jason i want 30 X 30 in 480 X 480 bitmap. I'm doing some pixel manipulations like color change and blur, so i wanted to decrease pixel size 30 X 30, but keeping the height and width intact. The primary focus is to make reduced 30 X 30 blurred at height 480 and width 480.Abhilash Muthuraj
@JasonSturges yes i want to have 30 X 30 in 480 X 480 bitmap.Abhilash Muthuraj

1 Answers

1
votes

Why don't you simply then make a copy of the whole image in code, but use the simple scaling to scale the copy, and only present that to the user. Also look at this from Stack Overflow

How to resize dynamically loaded image into flash (as3)