Commodore 64 AI Image Generator Developer Nick Bild built a generative image system that runs on a Commodore 64, adapting a probabilistic PCA algorithm to produce 8x8 retro game sprites from roughly 100 hand-made training sprites. Bild trained the model on a modern computer using modified Python tutorial code, then converted simplified logic into BASIC that runs on the C64 and expands each 8x8 image to 64x64 for display; at 94 iterations the generation takes about 20 minutes on the vintage machine. The project shows a stripped-down generative model can run on 1980s hardware where Stable Diffusion-class algorithms cannot. How It Works AI image generators are very popular these days, and the results are used in all sorts of creative projects. This made me wonder what it would have been like if image generators had existed during the early personal computer revolution in the 1980s. What would they have been like, and what would the images have been used for? Today's algorithms, like Stable Diffusion, require a huge amount of computational resources that simply cannot be made to work in any reasonable way on machines of the era. But with some work, a simpler generative algorithm could be used to produce images. So I decided to adapt a probabilistic PCA algorithm to run on a Commodore 64, with the goal of producing 8x8 retro game sprites that could have been used to inspire a game design. I started by building a model using a modified version of the Python code found in this tutorial https://github.com/smrfeld/python prob pca tutorial . I made about 100 retro-inspired sprites represented as binary strings https://github.com/nickbild/c64 gen ai/blob/main/train c64.txt with the help of a spreadsheet https://github.com/nickbild/c64 gen ai/blob/main/create sprites.ods I made. This data was used to train the model on a modern computer with modified scripts from the tutorial. This produces a number of parameter values a mean matrix, covariance matrix, etc. that only need to be calculated once for a given dataset. These were then plugged into a script https://github.com/nickbild/c64 gen ai/blob/main/pca custom.py I created with simplified logic — no NumPy or other libraries — to run the randomization and generative parts of the algorithm. This simplification made it easy to convert the logic into BASIC code https://github.com/nickbild/c64 gen ai/blob/main/make basic.py that is compatible with the Commodore 64. That code is then loaded onto a C64 to generate unique images that fit in the distribution of the training data. Finally, the 8x8 images are expanded to 64x64 and displayed on the screen. The number of iterations the algorithm goes through can be varied. More iterations produces better results generally, but takes longer. At 94 iterations, it takes about 20 minutes to run on a C64. Not really too bad considering how long a modern image generator would take on a modern computer without a GPU. Media Running on a C64: Samples of generated images: Bill of Materials - 1 x Commodore 64