This project is a simple command-line tool that applies various filters to BMP image files. The filters include grayscale, sepia, reflection, and blur. It is implemented in C and uses the BMP file format.
- Makefile: Instructions to compile the program using
clang
. - bmp.h: Defines data structures for handling BMP file headers and pixels.
- filter.c: Contains the main function that handles command-line arguments and applies the chosen filter.
- helpers.c: Implements the different image filters.
- helpers.h: Header file declaring the functions implemented in
helpers.c
.
- Grayscale: Converts the image to shades of gray.
- Sepia: Applies a sepia tone to the image.
- Reflection: Reflects the image horizontally.
- Blur: Applies a blur effect to the image.
Compile the program using the Makefile:
make filter
Run the program:
./filter [filter_flag] infile.bmp outfile.bmp
-b
: Blur-g
: Grayscale-r
: Reflection-s
: Sepia
To apply a sepia filter to an image:
./filter -s infile.bmp outfile.bmp
- The program only supports 24-bit uncompressed BMP 4.0 files.
- Ensure that your input file is in the correct format before using the tool.
This project is licensed under the MIT License.
### File Names
- **Main Program**: `filter.c`
- **Helper Functions**: `helpers.c` and `helpers.h`
### Instructions for Uploading to GitHub
1. Create a new repository named **BMPImageFilter** on GitHub.
2. Clone the repository to your local machine:
```bash
git clone https://github.com/ArnavBallinCode/BMPImageFilter.git
- Navigate to the repository directory:
cd BMPImageFilter
- Copy the provided files (
Makefile
,bmp.h
,filter.c
,helpers.c
,helpers.h
) to the repository directory. - Create the
README.md
file with the content provided above. - Add and commit the files:
git add . git commit -m "Initial commit with BMP image filters"
- Push the changes to GitHub:
git push origin main