Click here to Skip to main content
14,420,679 members
Rate this:
Please Sign up or sign in to vote.
Does anyone know of a library (managed or native) that can perform a gaussian blur of a windows CE screenshot (low res) in 1 or 2 seconds?

I found a PC one in C# and it took around 10 seconds.

My objective is to blur out the screen and paint an in focus popup box in the middle of the screen, I have the necessary tools for the alpha blending and so forth, but finding any sort of image manipulation library is proving to be a challenge.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

The trick to speeding up gaussian blur is to take advantage of its separability. That is, you can do one pass in the x direction (along each single row) and one pass in the y direction (down each column). Much faster than using a square kernel. Look up wikipedia for "gaussian blur"; the first external link even includes some code. For your application, you can affort to truncate the kernel pretty aggressively too. (I'm guessing 7x7 or even 5x5 will give you an acceptable result.)
[edit] You can probably get even more speedup using scaled integer arithmetic rather than float. Remember that you don't need NASA's gold-plated hammer to whack a nail into a plank! A lump of rock can do that job.[/edit]


To respond to this answer, add a comment to it and/or modify your question. Vote, and accept if you like it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100