Rzx008 commited on
Commit
ef707d2
verified
1 Parent(s): 5602f8b

Update iphone.py

Browse files
Files changed (1) hide show
  1. iphone.py +5 -4
iphone.py CHANGED
@@ -174,20 +174,20 @@ class IPhoneEditor:
174
  # Add new member count text
175
  updated_member_count = {
176
  'id': f"Grup 路 {anggota} anggota",
177
- 'en': f"Group 路 {anggota} member"
178
  }.get(lang)
179
 
180
  original_height = member_count_position['height']
181
  original_width = member_count_position['width']
182
 
183
- font_size = int(original_height * 1.8)
184
  font = ImageFont.truetype(self.font_path, font_size)
185
 
186
  image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
187
  draw = ImageDraw.Draw(image_pil)
188
 
189
- min_size = int(original_height * 1.3)
190
- max_size = int(original_height * 2.2)
191
  max_iterations = 10
192
  iteration = 0
193
 
@@ -224,6 +224,7 @@ class IPhoneEditor:
224
  draw.text((text_x, text_y), updated_member_count, font=font, fill=font_color)
225
  image = cv2.cvtColor(np.array(image_pil), cv2.COLOR_BGR2RGB)
226
 
 
227
  if show_preview:
228
  cv2.imshow('Preview (Tekan q untuk keluar)', image)
229
  while True:
 
174
  # Add new member count text
175
  updated_member_count = {
176
  'id': f"Grup 路 {anggota} anggota",
177
+ 'en': f"Group 路 {anggota} members"
178
  }.get(lang)
179
 
180
  original_height = member_count_position['height']
181
  original_width = member_count_position['width']
182
 
183
+ font_size = int(original_height * 1.9)
184
  font = ImageFont.truetype(self.font_path, font_size)
185
 
186
  image_pil = Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
187
  draw = ImageDraw.Draw(image_pil)
188
 
189
+ min_size = int(original_height * 1.4)
190
+ max_size = int(original_height * 2.3)
191
  max_iterations = 10
192
  iteration = 0
193
 
 
224
  draw.text((text_x, text_y), updated_member_count, font=font, fill=font_color)
225
  image = cv2.cvtColor(np.array(image_pil), cv2.COLOR_BGR2RGB)
226
 
227
+ cv2.imwrite('output.png', image)
228
  if show_preview:
229
  cv2.imshow('Preview (Tekan q untuk keluar)', image)
230
  while True: