A CS50 Project - Image manipulation and filtering
Clone the repository, or download it as a zip file and unzip it
$ git clone git@github.com:tomwhross/cd50-filter.git
The program takes three arguments
- The filter switch
-g: apply greyscale (black and white) filter
-s: apply sepia filter
-r: relect the image horizontally
-b: blur the image with a box-blur filter
- The input image file
- The output image file
Example applying grey scale:
$ ./filter -g images/yard.bmp out.bmp
Run the following to compile a new version:
$ make -B filter
Note the -B
flag (for always-make
) may or may not be required depending on your setup
If you are running on a version of MacOS on a version later than Mojave, C development can be somewhat difficult. One solution is to use Docker. To compile or run this program, or to debug it or run valgrind on it, run the following first:
$ docker run -it --rm -v "$PWD":/usr/src/filter nloomans/codam
This will allow you to perform actions like the following with ease:
# cd usr/src/filter
# make -B filter
# valgrind ./filter -r images/yard.bmp reflect_yard.bmp
# ./filter -g images/yard.bmp out.bmp