Update app.py
Browse files
app.py
CHANGED
@@ -35,20 +35,20 @@ def apply_filter(image, filter_type, intensity):
|
|
35 |
enhanced_image = np.array(image_pil)
|
36 |
return enhanced_image
|
37 |
elif filter_type == "Warm Tone":
|
38 |
-
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์
|
39 |
-
warm_image = cv2.addWeighted(image, 1.0, np.full(image.shape, (
|
40 |
return warm_image
|
41 |
elif filter_type == "Cold Tone":
|
42 |
-
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์
|
43 |
-
cold_image = cv2.addWeighted(image, 1.0, np.full(image.shape, (
|
44 |
return cold_image
|
45 |
elif filter_type == "High-Key":
|
46 |
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์
|
47 |
high_key = cv2.convertScaleAbs(image, alpha=1.0 + 0.3 * normalized_intensity, beta=20)
|
48 |
return high_key
|
49 |
elif filter_type == "Low-Key":
|
50 |
-
# ๊ฐ๋๋ฅผ
|
51 |
-
low_key = cv2.convertScaleAbs(image, alpha=1.0 - 0.
|
52 |
return low_key
|
53 |
elif filter_type == "Haze":
|
54 |
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์
|
|
|
35 |
enhanced_image = np.array(image_pil)
|
36 |
return enhanced_image
|
37 |
elif filter_type == "Warm Tone":
|
38 |
+
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์ (๋ฐ๋ปํ ํค ์ ์ฉ)
|
39 |
+
warm_image = cv2.addWeighted(image, 1.0, np.full(image.shape, (20, 66, 112), dtype=np.uint8), 0.3 * normalized_intensity, 0)
|
40 |
return warm_image
|
41 |
elif filter_type == "Cold Tone":
|
42 |
+
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์ (์ฐจ๊ฐ์ด ํค ์ ์ฉ)
|
43 |
+
cold_image = cv2.addWeighted(image, 1.0, np.full(image.shape, (112, 66, 20), dtype=np.uint8), 0.3 * normalized_intensity, 0)
|
44 |
return cold_image
|
45 |
elif filter_type == "High-Key":
|
46 |
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์
|
47 |
high_key = cv2.convertScaleAbs(image, alpha=1.0 + 0.3 * normalized_intensity, beta=20)
|
48 |
return high_key
|
49 |
elif filter_type == "Low-Key":
|
50 |
+
# ๊ฐ๋๋ฅผ 10%๋ก ์ค์
|
51 |
+
low_key = cv2.convertScaleAbs(image, alpha=1.0 - 0.1 * normalized_intensity, beta=-10)
|
52 |
return low_key
|
53 |
elif filter_type == "Haze":
|
54 |
# ๊ฐ๋๋ฅผ 30%๋ก ์ค์
|