Skip to content

Commit 7e99a6a

Browse files
committed
Merge all features, update documentation and resolve any prior conflicts
1 parent 7ae89a1 commit 7e99a6a

File tree

4 files changed

+0
-33
lines changed

4 files changed

+0
-33
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ For a pixel along the edge or corner, like pixel 15, we would still look for all
113113

114114
If you apply the above algorithm to each pixel in the image, the result should look like a blurry, out-of-focus version of the original.
115115

116-
### 5.) Threshold Filter (Black & White)
117-
- **Flag:** `-t`
118-
- **Description:** Converts each pixel in the image to pure black or white based on its intensity. If the average of red, green, and blue is greater than or equal to 128, the pixel becomes white (255,255,255); otherwise, it becomes black (0,0,0).
119-
- **Usage example:**
120-
```sh
121-
./filter -t input.bmp output.bmp
122-
```
123-
124116
### 6.) Brightness Adjustment Filter
125117
- **Flag:** `-B <value>`
126118
- **Description:** Increases or decreases the brightness of the image by adding a fixed value to each pixel's R, G, and B channels. The value should be an integer—positive to increase, negative to decrease.

filter.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ int main(int argc, char *argv[])
126126
invert(height,width,image);
127127
break;
128128

129-
// Threshold (black & white)
130-
case 't':
131-
threshold(height, width, image);
132-
break;
133-
134129
// Brightness Adjust
135130
case 'B': {
136131
int brightness_value = 0;

helpers.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,6 @@ void blur(int height, int width, RGBTRIPLE image[height][width]) {
102102
free(temp);
103103
}
104104

105-
void threshold(int height, int width, RGBTRIPLE image[height][width]) {
106-
for (int i = 0; i < height; i++) {
107-
for (int j = 0; j < width; j++) {
108-
int avg = (image[i][j].rgbtRed + image[i][j].rgbtGreen + image[i][j].rgbtBlue) / 3;
109-
if (avg >= 128) {
110-
image[i][j].rgbtRed = 255;
111-
image[i][j].rgbtGreen = 255;
112-
image[i][j].rgbtBlue = 255;
113-
} else {
114-
image[i][j].rgbtRed = 0;
115-
image[i][j].rgbtGreen = 0;
116-
image[i][j].rgbtBlue = 0;
117-
}
118-
}
119-
}
120-
}
121-
122105
void brightness(int height, int width, RGBTRIPLE image[height][width], int value) {
123106
for (int i = 0; i < height; i++) {
124107
for (int j = 0; j < width; j++) {

helpers.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,5 @@ void reflect(int height, int width, RGBTRIPLE image[height][width]);
1515
// Blur image
1616
void blur(int height, int width, RGBTRIPLE image[height][width]);
1717

18-
// Threshold filter (black and white)
19-
void threshold(int height, int width, RGBTRIPLE image[height][width]);
20-
2118
// Brightness adjustment filter
2219
void brightness(int height, int width, RGBTRIPLE image[height][width], int value);

0 commit comments

Comments
 (0)