Posted on December 24, 2021

Patchwork Kingdoms

“Patchwork Kingdoms” is a data + generative art project, a charity NFT collection, that I created for UNICEF’s Giga project. Giga aims to connect all schools in the world to the internet. They have a large database with information about schools, specifically if the school is connected to the internet or not. I used this data, on 283,000 schools, to create an algorithm that spread the schools out over 1000 tiny kingdoms, turning each school into a little square, while using both randomness and other aspects of the data to guide the visual appearance.

You can sign up for a spot on the whitelist to mint a Patchwork Kingdom on this page. If you want to join the growing Giga community, to stay up-to-date about the drop (scheduled for January 2022), see sneak peeks of the art, and learn more about (crypto) roadmap that Giga has planned, join me in the Giga Discord!

All 1000 Patchwork Kingdoms form a grid of 40x25 where the background patterns flow from kingdom to kingdom. Here you can see a tiny example of 15 Patchwork Kingdoms connected together.

Note | To keep things more exciting for now, all images used on this page are from a test run. None of these will be in the final set. The images here are however perfect representations of the final art (although I’m keeping some of the most special and rare outcomes hidden as well until after the drop, again, for the surprise ʕ•ᴥ•ʔ )

In this post I want to explain more about the initial inspiration, the creation process and go into a deep dive on how I used the data within my algorithm. If some things about the data or visual design aren’t clear after reading though it all, feel free to ask away in a tweet to me or ping me in the Giga discord.


With the topic being about schools and children, I felt I wanted the design style to evoke a sense of childhood. However, with the schools being based all over the world, I also wanted something that could be quite universal. From there I was drawn to doing something with simple basic shapes such as the triangle, circle, and square.

This reminded me of the wooden building block set from my father that I’d played with extensively as a kid. Creating entire cities from these diverse, but basic shapes. A toy uniquely tied to childhood, where separate shapes are combined and connected to form something greater. As an extra benefit, they’re generally made from natural materials. Finally, although I couldn’t find a source, I expect this to be a toy that exists, in some form, in many cultures across the world.

Two examples of wooden building block sets, from core77 and SutiCraftShop (on Etsy), on the left and right, respectively

I’ve also been inspired by illustrations from others, who in turn were inspired by Mary Blair, in particular by “Dennisthebadger”. Sadly I can only find his work on Pinterest with dead links.

With this idea of “cities build from simple building blocks” I started looking for inspiration online. It didn’t take me long to come across the wonderful concept art that Mary Blair made for Disney’s “It’s a Small World”, which immediately stuck with me.

An example of Mary Blair's 'It's a Small World' concept art

An idea started to form in my head where each school would be represented by a tiny decorated square. These squares would be stacked to form the cities, kingdoms, together. However, there would be a divide, a digital divide, where the schools already connected to the internet would be a bustling city with vibrant colors and complex decorations. The schools not yet connected would instead form a hidden upside down community, using more muted colors, and only very simple decorations.

Although I wanted the final result to look beautiful, whimsical, childlike, this splitting of the schools would remain to make the main point apparent; that there are still many schools that haven’t been connected to the internet.

Demonstrating the reason why I draw with code and not by hand.

I drew a (quite horrible looking) sketch to convey my idea to UNICEF and Snowcrash, and thankfully they loved the idea (ノ◕ヮ◕)ノ*:・゚✧ and thus I continued to work out the idea further.

My (pretty dreadful looking) design sketch for the idea of the two separated kingdoms

A few days after presenting my idea, I heard from someone on the team that Mary Blair actually created “It’s a Small World” for UNICEF at the 1964 World Fair. That’s some serious serendipitous circling-back going on there!

Data Preparation

At the end of October 2021 I received a data dump with all of the information that UNICEF’s Giga project had gathered up till that point. They have a brilliant interactive website where you can see all the schools mapped, more than a million already!

The interactive Giga Connect map where you can browse through all of the schools already mapped

For the countries in blue in the image above, they also know if the schools are connected to the internet. And if they are, they often also know the (rough) connection speed and the type of connection.

Within the 21 countries there is a small percentage of schools for which the data about connectivity is unknown. I’ve kept these schools in the data.

Because the fundament of my design was to juxtaposition the schools that were already connected to the internet with those that weren’t, I filtered the dataset to only the 21 countries where this information was known. That left me with just over 283,000 schools!

Because these NFTs are heavily relying on the data of the schools to create each Patchwork Kingdom, about 32MB worth of data, it would be madness to save the script and data on-chain. I have not curated the outputs of the Patchwork Kingdoms though. Once I felt that my visual algorithm was done, I started a batch job to create all 1000 Patchwork Kingdoms in one go.

I used R to do the data preparation, mainly separating the schools into 1000 clusters.

With the collection becoming 1000 pieces in total, each school had to be mapped to a specific “cluster”, as I called them, with there being 1000 clusters. On average that would give me 283 schools per cluster. Initially I thought that would be too much, but after actually working on the visuals I realized that it was a really good average to work with.

The value of 170 came from explorations on seeing when I felt the resulting visuals had too few schools (or too many) lessening the visual appeal.

I could’ve randomly assigned the schools to any number between 1 - 1000 and then group them by that number. However that wouldn’t create a lot of diversity. Most clusters will of course have more or less schools than exactly 283, but only a few would deviate strongly from 283. Instead, I created a function that would spread out the number of schools assigned per cluster to lie, about evenly, between 280 plus and minus 170 (thus between 280 - 170 = 110 and 280 + 170 = 450). I make sure to shuffle the schools a few times throughout my code so the assignment to, and groupings per cluster are completely random.

The underlying grid on which each kingdom is drawn is determined by the number of schools to visualize. The larger the number of schools, the more rows and columns the grid needs to place them all, and thus the smaller each separate grid cell (i.e. the size of the square representing one school) becomes.

A Patchwork Kingdom with few schools on the left versus one with many schools on the right

I personally have no preference for any specific number of schools. I like how the large clusters are showing many tiny squares which can create a multitude of intricate patterns. Whereas for small clusters the grid cells are quite large, better revealing the internal decorations and symbols for each school.

There’s one final thing that I do during the data preparation, which creates a few rare instances (but I have no say on which clusters will exhibit this, that’s randomly decided), that I’ll explain here after the drop ( ^∇^)

Note | There is an offline metadata document per Patchwork Kingdom that contains information about exactly which schools are visualized in each NFT, giving people the chance to perhaps collect a specific Patchwork Kingdom on the secondary market, because a school that is special to them is in there. These files are with the Giga team and I believe they might also be used in upcoming drops and shared through their servers (although at this moment this hasn’t been created yet).

Data Design

In this section I’ll explain all of the details on how the data of the schools determines the visual look of the Patchwork Kingdoms. I apologize if this goes into too much detail. Being a former scientist I find it hard to not explain every little thing (*^▽^*)ゞ

Placing the Schools

A main visual component of the Patchwork Kingdoms is that there is a divide between several groups of schools:

I loop over the schools from each of these groups and basically “build up the city from the bottom”, checking which places in the grid are free that are either right above the ground or above another already placed school. For the upside down kingdoms, it’s “building down” in a sense. The “data unavailable” schools are scattered randomly over the remaining grid positions, after having placed the other two groups, which by definition is the sky.

The unconnected schools in the upside down kingdom are placed following a uniform distribution; there’s generally no peak, only a few “towers” that might stick out from the rest, but those towers are often about the same height. For the connected schools however I let the placement of the schools follow a gaussian distribution. This create a more peaked result, with higher structures in the center. I based this on the idea that city centers are generally the places where you find the high rise buildings; the closer to the city center, the higher the buildings (on average-ish).

Tiny towers in between high-rising ones and large towers on the outskirts of the kingdom can still happen of course, even if the schools are, on average, placed with a gaussian distribution

Symbol Complexity

Quite amazing how many diverse symbols you can build up from very basic shapes!

Each school gets a “symbol” assigned to it. This is determined randomly for >95% of the schools, but I’ll explain the exceptions later. I started by drawing more than 100 little squares in my notebook and seeing what different kinds of shapes I could come up with, while also using inspiration from images on geometric patterns. My goal was to only use basic forms to create each symbol: squares, triangles, rectangles, (parts of) circles. Only a handful of final symbols deviate from this, such as the heart and the arched windows.

To design the symbols I draw >100 squares in my notebook and drew little designs for each

Actually programming all these took days of work, and not all looked good when combined with the other symbols, but eventually I was left with 51 unique symbols.

There are a few exceptions to this, symbols with only 1 level of complexity, but these all belong to the more general symbol exceptions explained later.

Furthermore, I created different levels of complexity per symbol. This is generally done by layering more shapes on top of, or next to each other. For example, you can have one circle, or two or three concentric circles. The same with triangles; either one, two or three on top of each other. Or one rectangle dividing a square, or two or three thinner rectangles. Meaning that there are much more than 51 unique patterns that can be found across the collection.

I use the internet speed of a school to determine what level of complexity is drawn. The higher the speed, the more complex the symbol.

I use an approximate quantile division for this; if the chosen symbol has two levels of complexity, a speed lower than 50% of all speeds will result in the level 1 complexity, while a speed higher than the 50% value gets a level 2 complexity. The same concept applies for symbols with three or four levels of complexity, but then with 3 and 4 splits between the lowest and fastest speed.

The Exceptions | Doors & Flowers

There are two exceptions to a school getting a completely random symbol:

Several doors and even more flower heads (and even 'full flowers' - see the 'Combined Symbols' section below)

Combined Symbols

The placement of the schools within each kingdom happens randomly. That sometimes creates a tiny grouping of schools that have some data value in common. For example, two (or more) schools next to each other in a row or column could be from the same country or use the same internet connection type. In those specific “serendipitous” cases I turn all of the schools from the tiny group into a “combined symbol”; they sync up their designs, rotations, and colors in a way to get a “1 + 1 = 3” result.

Sketching 'combined' symbols to see how I could stack, rotate, and combine certain shapes into something bigger

There’s also a subtle ‘bird’ symbol formed in this way that is one of my personal favorites!

Sometimes you get a pattern that repeats in a row, column, large square, or cross shape. Sometimes the separate synced symbols form a (big) seemingly new symbol when combined just right.

Two Patchwork Kingdoms with many 'combined symbols', such as rows, columns, grids and even crosses in both

Even though I’ve set-up several of these combined symbols in advance, I find that the unintended combinations, those that I didn’t specifically script, but appear through randomness, are some of the best (and are the most fun to go hunting for).

Some of my favorite 'unintended' combinations happen when a school and the turret on top combine in a magical way
Flowers & Rainbows

In the previous section I explained how the schools with the fastest internet speeds are turned into flower shapes. If two of those high speed schools are placed above one another it turns into a “full flower” with petals! The symbol of the school on the bottom turns into a double petal symbol. Furthermore, even more flower heads are “unlocked” in this case!

When those two schools are placed side by side I felt that a flower design couldn’t easily be used anymore (we don’t generally think of flowers growing sideways). Instead, I then turn the two schools into a rainbow; each school being drawn as one half (ノ◕ヮ◕)ノ*:・゚✧ With how often rainbows are drawn by children and how often they appear in childlike designs, I really wanted to incorporate a rainbow into my algorithm / design somewhere, and this felt like a great place.

A 'full flower' and rainbow side by side in this Patchwork Kingdom, on the left side

(Tiny) Note | The speed for two high speed schools to “combine” into a large flower or rainbow is a little lower than for a school to become a flower symbol on its own. This to make them appear just a little more often (who doesn’t want more flowers and rainbows!).

Specifics of the Upside Down Kingdoms

There are a few ways in which the upside down kingdom, the unconnected schools, differs from the upright one:

Visual Design

The overarching idea that guided basically all visual decisions for me, down to the names of the color palettes, was that the end result should evoke that feeling of the wonder that we feel as children. Be fantastical, magical, fun, happy.

I guess most of the design has already been discussed in the “Data Design” section above, since most is connected to data. However, let me quickly touch upon a few visual aspects that are not determined by the data.


The turrets on top of the upright kingdom are completely randomly chosen. I do however take into account when multiple towers have the same height side-by-side. In those cases there’s a high chance of them getting a combined, larger turret.

Some of my favorite 'turret decorations' are the giant heart and long bellowing flag

The “giant heart” on top came from a mistake in my code that made the heart shape appear much too large. However, I really liked the result and I kept it in, it’s a feature! (⌐■_■)


A handful of the color palette names are from lovely people sending in suggestions to a series of tweets that I send out asking for improved names.

You can see examples of several color palettes on this page. After the drop I’ll show all unique options side-by-side here. For now I’ll mention that there are 24 in total, with names such as “Fruit Loops”, “Marshmallow”, “Dragons”, “Unicorn”, “Strawberry Frosting”, “Slime”, and “Superpowers”. Trying to find candy, mystical creature, or other names that generally bring a sense of wonder and joy to children.

Kingdom Names

Each Patchwork Kingdom is marked by an ID, running from 1 to 1000, e.g. Patchwork Kingdom #1. This is to make sure that they can easily be kept in the correct order and to make it easier to eventually collect Kingdoms that are placed side-by-side, because all Patchwork Kingdoms together form a giant map! (see the “Quilt” section below)

However, that felt too… bureaucratic / boring / sterile in a way. Instead, I wanted to give each Patchwork Kingdom its own name, to make it come more alive and be unique. However, since I’m not good in naming things in the first place, and because doing that 1000 times would drive me crazy, I searched for an online place name generator. Specifically one for fantasy names, these are kingdoms of course.

Many of the fantasy place name generators had a very English village vibe to them, whereas I really wanted something that you’d not specifically associate with a culture on Earth. Thankfully, I eventually found Nerd Burglars with amazingly otherworldly fantasy sounding names, such as “Cerhila”, and “Alamaskala”, exactly the style I was looking for!

With a dedication of manual labor and a smidge of code did I gather 1000 unique names from their generator, which are used in the titles and description of each NFT. Instead of Patchwork Kingdom #1 we now have Patchwork Kingdom #1 | Lanisma. Much better right!

Collection Name

Talking about names, I also want say a big thank you to Eloi Durant for suggesting the name “Patchwork Kingdoms” for the collection as a whole when I asked for advice on Twitter. I was totally stuck, only knowing roughly what I wanted, but that one immediately clicked!

Other Special Designs

Once Patchwork Kingdoms has sold out I’ll expand on this section to show exactly what other aspects I’ve kept hidden for now ^.~

The Patchwork Quilt

As an extra fun element, all 1000 Patchwork Kingdoms together form a giant map of 40 kingdoms wide and 25 kingdoms high. With each separate Patchwork Kingdom being a “city on the map” in a way. Where each can be connected to specific neighbors to align perfectly.

I wanted this effect to be subtle, to not distract from the main kingdoms.

Inspired by the height lines, the isolines, on maps, the backgrounds are showing subtly undulating areas that connect into bigger shapes when a Patchwork Kingdom is placed next to its “official” neighbors, see the example below.

An example of four Patchwork Kingdoms that have their backgrounds perfectly aligned

I hope this will make some collectors want to collect, and enjoy the hunt, of finding specific Patchwork Kingdoms on the secondary market that are neighbors! ᕦ(ò_óˇ)ᕤ

The Quilt NFT

On the evening of January 13th, 2022 an NFT auction of five works by 4 artists was held to raise funds for the Giga project, held during the Crypto Finance Conference (CFC) in St. Moritz, Switzerland.

There was an auctioneer from Christie’s!

When I was asked if I wanted to send in a piece for the auction it was apparent to me and Chris (from Giga) that an NFT of the full map, of all 1000 Patchwork Kingdoms, would make the most sense for this special occasion; The Patchwork Quilt And I’m extremely happy that the Patchwork Quilt eventually sold for 10 ethereum! (ノ◕ヮ◕)ノ*:・゚✧

The auction took place in the Segantini museum in St. Moritz

Wrapping Up

Thanks for reading all the way till here! I hope you enjoyed learning about the data and design side that went into creating the Patchwork Kingdoms.

You can sign up for a spot on the whitelist to mint a Patchwork Kingdom on this page. If you want to join the growing Giga community, to stay up-to-date about the drop (scheduled for January 2022), see sneak peeks of the art, and learn more about (crypto) roadmap that Giga has planned, join me in the Giga Discord!

Looking forward to the minting in January!

See also