Load Your Pictures

As is, the code has no pictures on the CIRCUITPY drive to use in your slideshow. Let's get some. 

While the slideshow code is short and simple, know that microcontrollers, unlike computers, don't have the greatest amount of speed and memory. So any scaling of images and conversion of graphics formats should be done on your computer before they are copied to your device.

All images must be in .bmp format.

The size of the image depends on the size of your display. Here are some dimensions, if there is a board without an entry, go to the Adafruit product page to see the specifications for the display and use those.

  • PyPortal - 320x240 pixels (landscape)
  • PyBadge and PyBadge LC - 160x128 pixels (landscape)
  • PyGamer - 160x128 pixels (landscape)
  • Hallowing M0 Express - 128x128 pixels (portrait)
  • Monster M4sk and HalloWing M4 Express - 240x240 pixels (square)

The image editing software available is dependent on the operating system you are using. The GNU program GIMP runs on all operating systems and is free.

In your editing software, open the image you want in the slideshow. Resize the image to the demensions for your device. Then save the image in BMP format in a folder on your computer.

The slideshow code is set to show the pictures in alphabetical order. It is suggested you save the pictures sequentially, re. the first one is saved as 001.bmp, the second as 002.bmp, etc., this will allow for 999 images you can display in order.

You can name your files any names you want (keep the filenames from being absurdly long though). Just know they'll be run in alphabetical order. If you would like random pictures, you can change that later in this guide.

Copying the Pictures to Your Device

In your computer's file explorer/finder, create a new directory on your CIRCUITPY drive names images.

Go to the folder you copied your resized BMP images into and copy the files to your CIRCUITPY\images directory. Once done, the device should reset and run your slideshow!

Feel free to reorder your images by changing filenames, if necessary.

Sample Pictures

Below are sets of 6 sample pictures, formatted for the devices listed above.

What happens when you use larger images than the display resolution? You'll see as much of the picture as the display can render, say 160x128 pixels out of a larger 320x240 picture. At this time, CircuitPython cannot change the resolutions of files for display. Perhaps one day.

These images are from Unsplash and come with an unlimited, free license.

This guide was first published on Aug 12, 2019. It was last updated on Aug 12, 2019. This page (Load Your Pictures) was last updated on Aug 23, 2019.