Code + CPR + Open Data = Personalized generative art

Merete Sanderhoff
SMK Open
Published in
5 min readFeb 10, 2023
Image generated from Constantin Hansen, Prometheus Moulding Man from Clay, 1845, SMK

Imagine owning a unique artwork rooted in Danish cultural heritage the moment you are born and assigned a social security number. Does that sound far-fetched? Well, it’s absolutely possible! In this guest post by Stig Møller Hansen, a Senior Associate Professor at The Danish School of Media and Journalism, he lets us in on a highly surprising and thoughtprovoking way of using SMK Open.

In 2021, I was invited to participate in Artware8, an art exhibition held in Lima, Peru, where several artists explored how cultural identity could be incorporated into code-based generative art.

My contribution was based on the fact that Danes are one of the most registered people in the world. Since 1968, all Danish citizens have been assigned a ten-digit CPR number, which is used on a near-daily basis throughout society: in administrative offices, banks, hospitals, libraries, workplaces, and schools — to name a few. However, the purpose is always utilitarian, such as to reserve, pay, order, confirm, sign, etc. I was curious to test whether the CPR number could also act as a catalyst for creating a society-owned yet personalized aesthetic experience. And don’t worry: no sensitive information was compromised and no government servers were hacked in the process.

Prompted by the Artware8 exhibition’s theme of cultural identity, my idea was to pair the CPR number’s unique sequence of numbers with objects from the rich history of Danish art. To that end, SMK Open turned out to be a free and immensely useful resource. My initial tests proved that with some math, code, and a few queries to a database, I could easily assign each Dane a specific artwork from SMK’s collection based on their social security number.

Spurred by my initial experiments, I purchased a handheld barcode scanner — the kind you see in supermarkets and stores. At the press of a button, it scanned the barcode on a health insurance card and returned the CPR number as a text string. I subjected this text string to a series of mathematical operations, which converted the ten digits into a number between 0 and 2147483647. This huge number was then — using more math — converted to a corresponding work by a Danish artist from the SMK collection. All this happens behind the scenes. End users will simply scan their health insurance card and receive the associated artwork.

Now, merely displaying an image from SMK Open on a screen was obviously not enough. I wanted to use the image as a basis for generating a new artwork with its own visual expression. Cut it up and paint with it. Remix it. Use it in a new context.

After many experiments in several directions, I arrived at an algorithm that — briefly explained for the technically inclined — works like this:

  • Instantiate 50–100 code-based autonomous agents
  • Place each agent at a random location on a digital canvas
  • Assign each agent a lifespan and an initial size
  • Draw each agent using either a solid color or a round cutout sampled from the original artwork received from SMK Open
  • All agents follow the same motion pattern (drifting rotating spirals) but with different settings
  • When the system is put into motion, a chaotic jumble occurs as the agents move around and get smaller as their “age” grows toward their predetermined lifespan
  • The traces made by the agents eventually form the final piece

This video illustrates the process as it unfolds:

The process is deterministic, meaning that a given CPR number will always generate the same artwork.

Here are some examples made by feeding randomly generated CPR numbers to the algorithm.

Seen collectively, the aesthetic “fingerprint” of the generated works is pretty uniform. Individually, however, there is significant diversity caused by the colors and textures sampled from the SMK Open images.

My contribution to Artware8 has sparked several questions and ideas in many dimensions:

  • The temporal dimension: imagine the work changing its appearance over time. It might look different when you are 5, 15, 50, or 100 years old.
  • The aesthetic dimension: currently, just a single algorithm is used to generate the artwork. But with little effort, the main idea can easily be turned into an open piece to allow code-savvy people to contribute custom “rendering engines” for a wealth of different looks and styles.
  • The commercial dimension: will you be willing to sell your unique artwork, owned and linked to you through your social security number, as an NFT?
  • The ethical dimension: Is it okay to use social security numbers for art projects? How is my CPR number being used? Who scans it? Where does it go? Is it deleted afterward? And if the CPR numbers are generated randomly — something anyone can do — they are still pointing to a real person who may be quite unaware that his/her CPR number has been used to create digital art.

For now, the project is tucked away in a corner of my hard drive. But maybe in the future, when visiting SMK, all Danes will be able to scan their health insurance card and see their personal, unique artwork unfold?

About Stig Møller Hansen

Stig Møller Hansen is a Senior Associate Professor, PhD at The Danish School of Media and Journalism based in Copenhagen, Denmark. Stig teaches, researches, and speaks about the intersection of visual communication, programming, and pedagogy. He shows designers how to invent and build their own design tools using code as a creative medium. Keep up with Stig’s activities here: https://linktr.ee/stigmollerhansen

--

--

Merete Sanderhoff
SMK Open

Curator/Senior Advisor of digital museum practice @smkmuseum. Art historian, OpenGLAMer, chair of Europeana Network, initiator of Sharing is Caring.