Kims12 commited on
Commit
223546c
โ€ข
1 Parent(s): 8621860

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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, (30, 10, 0), 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, (0, 0, 40), 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
- # ๊ฐ•๋„๋ฅผ 30%๋กœ ์„ค์ •
51
- low_key = cv2.convertScaleAbs(image, alpha=1.0 - 0.3 * normalized_intensity, beta=-20)
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%๋กœ ์„ค์ •