Skip to content

olegkhomenko/pixelate-me-tg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixelate Me: telegram bot to make beautiful pixelated profile pictures

Run

Use Google Colab to run

IMPORTANT: set your Telegram API token to TOKEN variable

Open In Colab

Algorithm's result example

Original image

orig

Result banner

Tunable options

You can configure parameters in function pixelate.

def pixelate(image: Union[str, np.ndarray],
             colors=10, factor=8, dither=False, quantize_by_factor=4,
             segmentation_network=None) -> dict

Just modify the line:

res = pixelate(img, segmentation_network=segm_net)

Future work

  • move from bot.polling() to webhooks
  • add heuristics for better pixel images
  • replace face detection algorithm w/ instance segmentation
    (face detection only works if your subject is facing forward)
  • replace white background w/ bg_color hyperparameter