A parallel implementation of Gaussian blur using pthreads to process the image in 4 concurrent segments. Supports 24-bit BMP files.
In a school project I was tasked with implementing multithreading to complete a specific task. Using pthreads I was able to multi-thread the process to apply a gaussian blur to a BMP image.
I don't believe that pthreads is supported on Windows, so i would be aware it may only run if you are on MacOS/Linux
Just run the following:
make
./blur <file_name>.bmp <blur_radius>
The resulting blurred image should be in output.bmp
In this implementation I used a typical gaussian blur filter for the image.
I precomputed the kernel to apply and then split the image into 4 regions for which the threads would then apply the blur.
There are better and faster ways to get the nice natural look of a gaussian blur. Many of them being related to downscaling and upscaling such as the Kawase blur.
For simplicity sake, I did not implement that :) For more information on Kawase blur check out this link:
If you would like to learn more about blur filters in general here are some helpful resources:
- Nvidia - Incremental Computation of the Gaussian
- 3Blue1Brown video on convolutions
- Computerphile video on gaussian blur
Doing this project made me realize how much I enjoy image processing. I may add onto this project or create a whole suite of tools for image processing someday.