Update app.py
Browse files
app.py
CHANGED
@@ -10,16 +10,16 @@ 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 |
-
# κΈ°λ³Έ
|
14 |
-
base_intensity = 0.
|
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 |
-
# κΈ°λ³Έ
|
22 |
-
base_intensity = 0.
|
23 |
adjusted_intensity = base_intensity + (normalized_intensity * (1 - base_intensity))
|
24 |
|
25 |
image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
|
|
|
10 |
if filter_type == "Grayscale":
|
11 |
return convert_to_grayscale(image)
|
12 |
elif filter_type == "Soft Glow":
|
13 |
+
# κΈ°λ³Έ 10% κ°λμμ μμνμ¬ μ΅λ 100% κ°λκΉμ§ μ‘°μ
|
14 |
+
base_intensity = 0.1
|
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 |
+
# κΈ°λ³Έ 50% κ°λμμ μμνμ¬ μ΅λ 100% κ°λκΉμ§ μ‘°μ
|
22 |
+
base_intensity = 0.5
|
23 |
adjusted_intensity = base_intensity + (normalized_intensity * (1 - base_intensity))
|
24 |
|
25 |
image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
|