Blur bitmap in AIR for Android

Subscribe to Blur bitmap in AIR for Android 6 posts

avatar for electrolyte electrolyte 37 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 …

 
avatar for feartehstickman feartehstickman 521 posts
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.

 
avatar for electrolyte electrolyte 37 posts
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

 
avatar for electrolyte electrolyte 37 posts
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

 
avatar for electrolyte electrolyte 37 posts
Flag Post

Desktop version using standard blur filter

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

 
avatar for vesperbot vesperbot 1847 posts
Flag Post

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