This Twitter Bot Can Colorize Black and White Photos in Seconds

The last photograph of Lenin, 1923.

Colorize Bot is an incredible Twitter tool that transforms black and white photos into color using artificial intelligence (AI).

The bot has proven popular on the platform with users summoning it to breathe fresh life into grayscale images ranging from old high school photos to historically significant images of world leaders.

The bot’s creator Asdrúbal Zambrano tells PetaPixel that despite being shadow-banned by Twitter a few months ago he still received thousands of requests per day.

“Being shadow-banned makes it much more difficult for me to gain followers,” he explains.

“The first year I got an average of 20,000 monthly followers and currently I only get 1,000.”

Zambrano says that the development of the bot took him three months while working on it part-time.

How Colorize Bot Works

The bot operates on webhooks, which is a component that fires an event every time someone mentions @colorize_bot.

“For the bot to be active 24/7, the webhook must be on a server listening for events. Once a mention is captured, it is processed and validated, that is, it is determined if the tweet where the bot was mentioned contains images,” says Zambrano.

If the user has a private account, then the bot will not be able to access the images. However, if a mention made by a user is validated then that’s where the magic happens.

“The images of the tweet are captured and then sent to the colorization API that Hotpot has, which returns a colored image in less than four seconds, which is something really amazing,” explains Zambrano.

Once the image has been colorized then the user’s original tweet is replied to with a message containing the new picture.

“From the process of capturing the mention to the response to a tweet, about five seconds pass,” explains Zambrano.

“However, currently the bot is programmed to respond every 30 seconds in case there are continuous mentions, this is in order not to break the rules of Twitter, which indicate that only 2,400 images can be answered in a day, that is, approximately 100 tweets in an hour.”

Another restriction on the program is the bot can only respond to three mentions per user per hour. Zambrano stores the users’ data locally and after each hour they are automatically deleted.

“This is in order to save costs, since, as is known, having this active 24 hours a day responding to all user mentions has an infrastructure cost that as a student I cannot easily afford.”

To have a black and white photo colorized in seconds, tag Colorize Bot on Twitter.