Catherine Maglione

Portfolio

LED Color Evolution

C++, 3D Printing, Evolutionary Algorithm

Frames

Project Overview

LED Color Evolution is an interactive light-based project that runs on a 64×64 RGB LED matrix cube. It uses an evolutionary algorithm to gradually morph the matrix display into a target image—pixel by pixel—creating a mesmerizing visual narrative of convergence, mutation, and transformation.

This project is based on and extends functionality from the rpi-rgb-led-matrix library, which was cloned as a base to drive the hardware display. From there, I developed custom animation demos using both genetic algorithms and guided mutation strategies.


Evolutionary Algorithm

I implemented a custom evolutionary algorithm to control the visuals on the LED cube. The algorithm operates by initializing a population of random RGB values for each pixel on the cube. For every generation, each pixel’s color is evaluated against the corresponding pixel in a target image using a fitness function based on RGB distance. The pixels then undergo mutation—slightly shifting their color values toward the target based on their fitness—until the overall display converges.

To extract pixel data from target images, I used ImageMagick to convert .png files into raw .ppm format, which I then parsed using C++ to read RGB values directly into memory. The entire process is handled in real-time on a Raspberry Pi 4 Model B, leveraging the rpi-rgb-led-matrix library for low-level hardware communication and frame updates.

The Cube Construction

I followed the Adafruit RGB LED Matrix Cube tutorial to guide the physical construction of the cube. I used six 64x64 RGB LED panels, 3D-printed corner brackets to form the cube structure, and carefully routed ribbon cables and power wires to ensure stable connections between panels. The setup is powered by a Raspberry Pi 4 Model B with an RGB Matrix Bonnet, which manages data transmission to each face of the cube. This hardware assembly laid the groundwork for my custom animations and interactive visual experiments.