Gimp and Scratch

Objectives and Overview

Gimp is a great tool for creating characters, backdrops, menu/skill bars, and any other necessary sprites. Gimp allows for a quick workflow for making pixel art- a style that works very well with Scratch.

Creating and importing from Gimp allows for much higher quality in design, and provides much more control and customization than Scratch’s art editor. One thing you’ll see as you work through Scratch and other game engines is the term assets. A simple definition is that assets are the things in the game, such as your character images, backgrounds, soundtrack and sound effects, text, and dialogue, and any other user-facing part of the game. Scratch manages any assets that you import. It’s good practice to understand how to incorporate your own art that you’ve created into Scratch projects, and that’s what this lesson is about.

Lesson Objectives

  • Be able to explain what an asset is
  • Demonstrate that you can import Gimp files into Scratch
  • Practice using the Costume Editor in Scratch
  • Import one of your Gimp assets into Scratch

Importing Files Into Scratch

One of the best aspects of using Gimp is that you can import your creations into Scratch as .png files. For non-pixel art, you’d want to use the .svg format, but for this particular style, you’re better importing into Scratch as a png and then scaling it within the Scratch costume editor. You’re also able to import other file formats, such as .jpg and .png.

You’ll likely need to scale your pixel art once it’s imported. It may lose some resolution. If this becomes too much of an issue for your liking, you can import the file as a .svg instead.

For example, if your imported character is too large and you need to make a quick fix, you can scale it in the internal editor. If you use the .svg format, you’re able to keep a good picture resolution while scaling in Scratch. This means that if you need to change the size of your sprites it will still keep a similar quality to your original design in Inkscape.

Activity: Importing Designs From Gimp

  1. Save your file as a .png in Gimp.
    • Save the file somewhere easy to access, such as the Desktop. Remember to upload any files you’re using to Google Drive!
  2. Find the upload icons in the bottom left corner of your Scratch program. You’ll notice there is one for backdrop and one for sprite.
    • Choose whichever is appropriate and you’ll be prompted to locate the file.
  3. Navigate to the file location (such as Desktop), select the file, and click open.

After you do this, the sprite will now appear with your Sprite Collection or as a Stage (Backdrop).

Activity: Importing Designs Into Costume Editor

  1. Save your file as a .png in Gimp.
    • Save the file somewhere easy to access, such as the Desktop. Remember to upload any files you’re using to Google Drive!
  2. Click the Costumes tab on the Editor panel. This switches from showing your code to showing the costumes of each sprite.
    • Note: If you have a sprite selected in your Sprites collection window, you will begin editing the costumes of the chosen sprite.
  3. There are two ways to import a new costume. First, click the Paint a New Costume tool under the New Costume text. Second, click the Import button in the Editor panel.
  4. You can resize, rotate and scale any of your imported images in the Editor.
  5. Once finished, click back on the Scripts tab to return to the Code editor.

What are Costumes?

Costumes are alternate appearances of a sprite. Costumes can also be thought of as frames in an animation. For example, Costume 1 could be a sprite with their legs positioned in one way, and then Costume 2 would be the same sprite with their legs positioned differently. In your scripts, you can have the sprite alternate between the two costumes resulting in the sprite appearing to walk forward.

Every sprite must have at least one costume. You can rename and delete your costumes from the Costume Editor panel. Costume switching is essential for giving your game an animated feel, and Inkscape is the perfect tool for creating multiple costumes for your sprites!