I analyzed the shape and color distribution of all flags to find the most similar. They follow each other in sequence, starting with the United States. But each flag can appear only once, so every flag is followed by the best match that hasn't been picked yet. But it still shows the best match, below. With another starting country the sequence would have been different.
Shape and color similarity is weighted equally, and according to rank. So the best is to have shape similarity rank of 1, and color similarity rank of 1. If the shape rank is 6 and color rank is 8, the overall rank is 7 - this is what is used to determine the best match.
Shape and color is analyzed separately, and shape only takes edges between colors into account. So a flag that is red above and white below will according to this ranking method be deemed to be similar to one that is red below and white above, since both the shape and overall color distribution is similar.
Some kind of machine learning approach could probably do a better job. This is the best I could do currently!
Music: Future Joust - On the Knife, from Epidemic Sound (www.epidemicsound.com)
Selected countries:
00:00 United States
00:05 United Kingdom
00:12 Russia
00:16 India
00:18 Egypt
00:27 Germany
00:35 Ethiopia
00:50 Indonesia
01:03 Mexico
01:24 Color distributions
01:49 Thailand
02:15 Nigeria
02:33 Australia
02:43 China
03:02 Turkey