Skip to content

Import Spritesheet

Animations are important for gameplay and aesthethic appearance. One of the best ways to animate a Sprite or graphic is to use a spritesheet with all the different frames of animation in one place.


To import a spritesheet, press the 'Import Sprite' button.

Import Sprite image 1
Import Sprite window

Find or make a spritesheet, and press 'Open Sheet Image' to open it in the Editor window.

Import Sprite image 2
Imported Spritesheet

To frame the frames you'd like to import, you'll need to edit the number of frames in X and Y and change the 'X frame count' and 'Y frame count' values.

Import Sprite image 3
Sprite altered x and y count

Then, change the Frame width and height(px) values to match the frames. You can divide the total width of pixels, in this case 250, by 'X frame count' 5 to get the correct 'Frame width (px)', and do the same for the height - 90 / 2 = 45 for the 'Frame height (px)'. If your frames are offset or aren't fitting using this method - use the arrows for the 'X and Y grid offset' or the 'X and Y grid gap' values to get the frame values that work for you.

Note: Spritesheets, and therefore sprites that are too big (larger than 72x40) will not fully display on the Thumby screen. Depending on the number and size of frames, you may get a memory error. Resize your image to smaller pixel values to solve this issue.

Import Sprite image 4
Sprite frame overlay

If the spritesheet you find isn't exactly monochrome, or the colors aren't very dark, it may help to toggle the 'Black/White Threshold' slider to alter what pixels are in the sprites. If it's not coming out the way you would like, try editing the image in a program like Photoshop or Microsoft Paint before coming back to the 'Import Sprite' tool.

Import Sprite image 5
Imported butterfly flutter spritesheet


Display Bitmap Frames Example

Once you have frames that you like, it's time to display them on the Thumby! Select 'Export Data ->' and choose the option that works for you:

  • 'To Clipboard' will copy the bitmap data and then you can paste (Ctrl+V) it to your program Editor panel.
  • 'To Editor' will create a .raw file containing all the frame information.

Here's an example of a short program displaying the butterfly flutter frames after using the 'To Clipboard' option:

Import Sprite animation
Butterfly Flutter animation on emulated Thumby screen

import thumby

# 50x45 for 10 frames
spriteFrames = bytearray([193,63,243,131,127,255,255,255,255,255,63,7,1,1,1,1,1,1,7,63,127,63,63,63,63,31,31,31,31,31,31,31,31,31,63,63,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,249,230,132,131,7,15,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,252,248,240,224,224,192,128,0,0,0,0,0,0,0,0,0,0,0,0,128,128,192,240,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,252,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,227,137,127,195,3,127,255,255,255,255,255,255,31,3,1,0,0,0,1,1,7,63,31,31,31,15,15,15,15,15,15,15,15,31,31,31,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,248,243,196,137,131,15,31,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,192,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,248,240,224,192,128,128,0,0,0,0,0,0,0,0,0,0,0,0,128,192,224,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,252,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,15,31,15,15,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,255,255,255,255,129,27,255,193,63,255,255,255,255,255,255,63,15,3,1,0,0,0,0,1,7,31,31,15,15,7,7,7,7,7,7,7,7,15,15,159,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,249,230,132,131,135,15,15,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,246,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,252,248,240,240,224,192,128,0,0,0,0,0,0,0,0,0,0,0,128,128,192,224,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,252,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,255,255,255,255,255,255,255,251,129,63,241,139,127,255,255,255,255,255,255,63,31,15,15,7,7,7,15,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,251,230,132,131,7,31,15,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,225,241,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,252,248,248,240,224,192,128,128,0,0,0,0,0,0,128,128,128,192,192,224,224,248,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,252,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,255,255,255,255,255,255,255,255,255,255,255,248,196,31,112,132,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,253,243,194,193,3,7,15,31,63,127,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,0,0,0,0,0,0,0,0,0,1,1,3,7,15,31,31,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,224,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,7,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,252,252,254,254,252,248,224,192,128,0,0,0,192,240,254,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,135,47,255,7,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,241,231,204,19,7,15,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,4,0,0,0,0,1,3,7,15,15,31,63,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,27,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,248,240,224,224,224,240,240,224,128,0,0,0,0,0,0,0,128,224,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,30,28,24,16,16,26,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,254,240,207,60,96,143,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,249,225,224,1,3,7,7,31,63,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,7,0,0,0,0,0,0,0,0,0,0,0,1,3,3,7,15,31,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,1,3,31,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,248,240,248,248,248,252,255,252,240,192,0,0,0,0,0,0,0,0,0,224,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,30,24,16,16,0,0,30,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,255,255,255,255,225,137,127,225,15,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,243,198,129,131,7,31,31,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,14,0,0,0,0,0,0,1,3,7,7,15,31,31,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,15,31,63,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,252,252,248,252,255,255,254,252,240,224,192,128,0,0,0,0,0,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,30,28,24,16,0,4,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,255,255,255,255,255,255,255,255,31,255,223,31,255,255,255,255,255,255,63,63,63,63,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,241,231,220,51,79,31,63,255,0,0,0,0,0,0,0,0,3,15,31,63,63,63,31,31,31,31,31,31,31,31,63,63,63,127,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,248,240,224,193,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,248,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,252,248,240,240,224,224,192,192,224,224,192,224,224,224,224,224,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,191,255,63,191,255,255,255,255,255,255,255,63,63,63,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,248,231,140,48,103,95,63,127,255,15,0,0,0,0,0,0,0,1,15,15,15,15,7,7,7,7,7,7,15,15,15,31,31,63,127,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,248,240,192,193,192,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,232,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,254,252,248,240,240,224,224,192,192,192,192,192,192,192,192,192,224,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31])
Spr = thumby.Sprite(50, 45, spriteFrames, 10, 3) 

# Increase this to make the flutter animation change frames faster
thumby.display.setFPS(10) 

while(True):
    thumby.display.fill(1) 

    thumby.display.drawSprite(Spr)
    Spr.setFrame(Spr.currentFrame+1)
    thumby.display.update()

Display .raw File Frames Example

To display the frames from a .raw file, the code is very similar and the display is the same as shown in the above gif. The most important thing to remember when emulating is to check the white 'Emulation' box to ensure it's included when emulating, or executing your program.

Include the name, and relevant file path of the .raw file when initializing the sprite object.

import thumby

# 50x45 for 10 frames
Spr = thumby.Sprite(50, 45, "sprite1.raw", 10, 3)

# Increase this to make the flutter animation change frames faster
thumby.display.setFPS(10)

while(True):
    thumby.display.fill(1) 

    thumby.display.drawSprite(Spr)
    Spr.setFrame(Spr.currentFrame+1)
    thumby.display.update()