Update app.py
Browse files
app.py
CHANGED
@@ -10,8 +10,12 @@ def apply_filter(image, filter_type, intensity):
|
|
10 |
if filter_type == "Grayscale":
|
11 |
return convert_to_grayscale(image)
|
12 |
elif filter_type == "Soft Glow":
|
|
|
|
|
|
|
|
|
13 |
gaussian = cv2.GaussianBlur(image, (15, 15), 0)
|
14 |
-
soft_glow = cv2.addWeighted(image, 1 -
|
15 |
return soft_glow
|
16 |
elif filter_type == "Portrait Enhancer":
|
17 |
# κΈ°λ³Έ 30% κ°λμμ μμνμ¬ μ΅λ 100% κ°λκΉμ§ μ‘°μ
|
|
|
10 |
if filter_type == "Grayscale":
|
11 |
return convert_to_grayscale(image)
|
12 |
elif filter_type == "Soft Glow":
|
13 |
+
# κΈ°λ³Έ 30% κ°λμμ μμνμ¬ μ΅λ 100% κ°λκΉμ§ μ‘°μ
|
14 |
+
base_intensity = 0.3
|
15 |
+
adjusted_intensity = base_intensity + (normalized_intensity * (1 - base_intensity))
|
16 |
+
|
17 |
gaussian = cv2.GaussianBlur(image, (15, 15), 0)
|
18 |
+
soft_glow = cv2.addWeighted(image, 1 - adjusted_intensity, gaussian, adjusted_intensity, 0)
|
19 |
return soft_glow
|
20 |
elif filter_type == "Portrait Enhancer":
|
21 |
# κΈ°λ³Έ 30% κ°λμμ μμνμ¬ μ΅λ 100% κ°λκΉμ§ μ‘°μ
|