This project provides a command-line tool for applying various image filters to bitmap images. The tool supports grayscale, sepia, reflection, and blur effects.
- Compiler: GCC or Clang (for compiling the source code)
- Input Images: Must be 24-bit uncompressed BMP 4.0 files
- Libraries: Standard C libraries, including math.h (linked with -lm)
To compile the source code, use the following command:
gcc -ggdb3 -gdwarf-4 -O0 -std=c11 -Wall -Werror -Wextra -Wno-gnu-folding-constant -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -lm -o filter filter.c helpers.cclang -ggdb3 -gdwarf-4 -O0 -std=c11 -Wall -Werror -Wextra -Wno-gnu-folding-constant -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow -lm -o filter filter.c helpers.cThis command will generate an executable named filter.
You can apply different filters to your images using the following commands:
Grayscale: Convert an image to grayscale:
./filter -g ./images/courtyard.bmp ./images/courtyard-grayscale.bmpSepia: Apply a sepia tone to an image:
./filter -s ./images/stadium.bmp ./images/stadium-sepia.bmpReflection: Create a horizontally reflected version of an image:
./filter -r ./images/tower.bmp ./images/tower-reflected.bmpBlur: Apply a blur effect to an image:
./filter -b ./images/yard.bmp ./images/yard-blurred.bmpBrighten: Increase the brightness of an image:
./filter -n ./images/sky.bmp ./images/sky-brightened.bmp-g: Apply grayscale filter-s: Apply sepia filter-r: Apply reflection filter-b: Apply blur filter-n: Apply brighten filter
- Place input images in the ./images/ directory or specify the correct path.
- Ensure the output directory exists and is writable.
- Only one filter can be applied per execution.
- The program checks for valid BMP file formats and will exit with an error message if the input file is unsupported.
- The brighten filter increases each RGB component by 50 (clamped to 255).