, 5 tweets, 3 min read Read on Twitter
This bot is entirelly written in Python3.7. Why? Because its fast for shitty scripts like this one.
First it gets the images randomly with the 2digit code.
Then it downloads them locally to work better with them.
This is done in a Ubuntu server but im taking screencaps in my PC.
Next step, with the 2Digit code we generate the emoji.
Now we go to the important part, we get a list of colours in the flag using Pillow lib. That list is ordered by number of pixels of each color.
Then we filter them and generate a RGB color list for each flag.
So, now we got a list of ordered colors from most to less appearances in each flag.
Now we are going to choose one flag to be the base and other to be the color palette.
How? Easy, we choose the flag with most colors to replace in the one with less to avoid empty replacements.
Then we have to normalize colors, both lists need to have same length to do the replacement.
Also we have the option to set reversed colors if countries are repeated

Finally we iterate over the image and replace each color 1:1
So the flags will be consequent with the originals
Finally i sanitize the names output ")" and "," are removed.

Then the "name generation" begins...
We have 2 options, 2 names only 1 word length, we split in the middle and join them.
One of them more than 1 word, we replace last or first word with the other country
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Flags Mashup Bot
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!