Skip to content

Commit 6c56c82

Browse files
Merge branch 'main' into feat/edge-detection
2 parents 9e8f70d + fb2260f commit 6c56c82

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,14 @@ 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.) The Vignette Algorithm
117-
118-
The vignette filter gives an image a cinematic look by gradually darkening its corners.
119-
120-
**Algorithm:**
121-
1. Compute the center of the image (cx, cy).
122-
2. Calculate the maximum distance from the center to any corner (max_dis).
123-
3. For each pixel at (i, j):
124-
- Calculate the Euclidean distance from this pixel to the center: dist = sqrt((j - cx)^2 + (i - cy)^2)
125-
- Compute a vignette factor: vig = 1.0 - (dist / max_dis)
126-
- Clamp vig between 0.0 (fully dark) and 1.0 (original color).
127-
- Multiply the pixel's R, G, B values by vig to darken farther-away pixels more thoroughly.
128-
129-
If you apply this algorithm, your resulting image will have gently darkened corners and an undisturbed/sunnier center.
116+
### 6.) Brightness Adjustment Filter
117+
- **Flag:** `-B <value>`
118+
- **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.
119+
- **Usage examples:**
120+
```sh
121+
./filter -B 40 input.bmp output.bmp # Increase brightness by 40
122+
./filter -B -30 input.bmp output.bmp # Decrease brightness by 30
123+
```
130124

131125
### 6.) The Threshold Algorithm
132126

helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ void brightness(int height, int width, RGBTRIPLE image[height][width], int value
3434
void vignette(int height, int width, RGBTRIPLE image[height][width]);
3535

3636

37-
#endif
37+
#endif

0 commit comments

Comments
 (0)