Blur bitmap in AIR for Android

6 posts

Flag Post

Hi,

I’m trying to blur a bitmap data object but the target platform is Android / Mobile which doesn’t support (as far as I’m aware) filters.

Has anyone got any ideas how a blur effect can be achieved? I have a bitmap, 256 X 256 that needs blurring, it’s not in a game loop so could loop through the bitmap data but not sure where to start …

 
Flag Post

There’s probably a way you can do it which involves adding a bit of the colour of each pixel to each of the surrounding pixels, but I’m not too sure about it.

 
Flag Post

Thanks, yeah I’m starting to think that’s the way forward, just tough getting head around the comparisons and off-shifting the colour values! :S

 
Flag Post

I sorted it after discovering this:

import fl.motion.Color;
Color.interpolateColor(colour1,colour2,ratio)

Then wrote a cheeky function that goes through the pixels, every other one, and plots a new colour half way between, if that makes sense :D

 
Flag Post

Desktop version using standard blur filter

Mobile version with the cheeky function. Quite like the lo-fi blurring :D

 
Flag Post

this even adds flavor to the graphics :) I like this :)