Skip to content

Commit

Permalink
Update pixelateTG.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arbadacarbaYK authored May 29, 2024
1 parent 067482a commit a60f95f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pixelateTG.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ def process_image(photo_path, user_id, session_id, bot):
roi = image[y:y+h, x:x+w]

# Apply pixelation to the ROI
roi = cv2.resize(roi, (PIXELATION_FACTOR, PIXELATION_FACTOR), interpolation=cv2.INTER_NEAREST)
pixelation_size = int(PIXELATION_FACTOR * min(w, h))
roi = cv2.resize(roi, (pixelation_size, pixelation_size), interpolation=cv2.INTER_NEAREST)
roi = cv2.resize(roi, (w, h), interpolation=cv2.INTER_NEAREST)

# Replace the original face region with the pixelated ROI
Expand Down

0 comments on commit a60f95f

Please sign in to comment.