Getting Started with Unicorn Paint

If you've picked up Unicorn Hat and want to give Unicorn Paint a go, then this is the guide for you.

Unicorn Paint is an advanced example, and assumes some basic knowledge that not everyone will have. We're going to try and fill those gaps below.

In this guide you'll learn how to:

  1. Install the Unicorn Hat modules
  2. Download the Unicorn Hat examples from GitHub
  3. Find your Raspberry Pi's IP address
  4. Start Unicorn Paint
  5. Connect to Unicorn Paint with your web browser and start painting.

How to install the Unicorn Hat modules

Installing modules can be trickier than it looks, the process for Python 2 and Python 3 is subtly different. We've tried to make the install process as simple as possible with this magical one liner:

curl | bash

You'll need to locate LXTerminal, or be logged into your Raspberry Pi's terminal to run this script. You can find out more about Unicorn Hat, and the setup process by reading our getting started with Unicorn Hat guide

This script will also prompt you to download the example code, make sure you answer yes. If you miss it, or need a fresh copy of the examples for any reason you can "clone" them with Git:

git clone

Find your Raspberry Pi's IP Address

If you're using the web browser on your Pi, you can simply skip this step and substitute the IP address we're looking for with This is the "local loopback" IP, and simply tells your browser to talk to the machine its running on, rather than look for another one across the network. In order to connect to your Pi from a web browser and use Unicorn Paint, you'll need to find your Pi's IP Address. Its IP address is like a postal address, and allows you to find your Pi on your local network.

If you know how to do this, go right ahead, otherwise read our guide to finding your Raspberry Pi's IP address

At the end of this kerfuffle you should be in possession of a number that looks something like: or perhaps Make a note of it.

Start Unicorn Paint

Before starting Unicorn Paint, you should make sure the dependencies are installed. Unicorn Paint requires the Python web framework Flask. To get it installed, just:

sudo pip install flask

Locate the code you downloaded earlier and make your way to the Unicorn Paint example folder. Then just type:

sudo ./

And Unicorn Paint should fire up on your Pi. Note: you won't see any graphical interface yet, we need to connect with a web browser from another computer, or your Pi, to get things working.

Connect to Unicorn Paint from your web browser

If you're running entirely on the Raspberry Pi, I'm going to assume you've got a desktop up and have Epiphany Browser installed. You should see an icon for it on your desktop if you do, click it and enter the following into the address bar:

Unicorn Paint in action.

If you've got the example running, you should see the interface pop up and be able to start painting. Enjoy!

If you're using a desktop PC or laptop, you'll have to use the IP Address that you found earlier and plug it into the address bar of your browser of choice. For example:

Hopefully the Unicorn Paint UI will come right up. Happy painting!

Shopping basket

Need something for this project? You can use the links below to add products to your Pimoroni Shop basket for easy checkout.

Unicorn HAT
Want to checkout or change something? Click here to view your cart.

Unicorn HAT, Raspberry Pi, Python, LEDs

Phil Howard
Phil is Pimoroni's software guru, instantly recognisable by his somewhat pirate-themed moustache growing attempts. Usually found buried neck deep in Python libraries, he's also been known to escape on occasion and turn out crazy new products. If you need a helping hand, he's a prolific Twitter user and rampages around the forums like a T-Rex. Ask him if you need help with Pimoroni's software libraries, or Propeller HAT.