Scratch Paint Editor
Scratch Paint Editor
Image Representation
An image is composed of small picture elements called pixels. These pixels
are arranged in a rectangular area, sometimes referred to as a raster. The
image size is frequently given by its width and height in pixels, as illustrated
in Figure 1.
16 pixels
16 pixels
includes the color of
each of its pixels.
When you use an image editor, the software saves certain information
that allows it to reload the image when you want to open it again. The saved
data and the way that data is arranged give rise to the image format.
One option is to save the information associated with each pixel of the
image, including its position and color. This approach is usually called bit-
map graphics (or raster graphics). Common bitmap image formats include
BMP, JPEG, PNG, GIF, and TIFF.
Other formats, called vector graphics, store the instructions or rules for
drawing pixels instead of information about the pixels themselves. These
rules use points, lines, curves, and mathematical expressions to represent
the image. Sprites drawn with vector graphics usually look much smoother
than bitmaps when you zoom in on them. Scratch recognizes the Scalable
Vector Graphics (SVG) format.
Scratch’s Paint Editor allows you to create both bitmap and vector
graphics. Bitmap graphics are the default, and vector graphics were added
in Scratch 2. The layout of the Paint Editor changes based on which mode
you select.
Bitmap Mode
When you create a new sprite or costume, the Paint Editor starts in bitmap
mode, as illustrated in Figure 2.
If you have used programs like Microsoft Paint, you’re probably famil-
iar with many of these options. You may be able to guess what the buttons
in Figure 2 do, but if you can’t, each button has a tool tip that describes its
function. You can see the tool tip by hovering the mouse pointer over any
button. The following sections provide more information, but the best way
to get familiar with this tool is to try it out as you read along.
Flip left-right
Flip up-down
Toolbar Set costume center
Drawing
canvas
(continued)
Text Add text. Click anywhere on the Canvas, type the text you
want when you see the cursor, and then click outside the text
area. The Select tool (see below) automatically selects your
text so you can change its size and orientation.
Click on the Canvas
1
and start typing.
Eraser Erase with freehand strokes and adjust the eraser size with the
slider. The areas that you erase become transparent.
Color Settings
The color controls allow you to set the foreground and background colors
of your drawing. These controls are described in Table 3.
Alternate palette Switch between the default palette and the con-
tinuous color palette.
2. Use the Line tool to draw three diagonal lines across the corners of the
two rectangles, as shown in Figure 4.
3. Use the Eraser tool to erase the parts of the rectangles that extend
beyond the lines you just drew. Then use the Line tool to draw a verti-
cal line as shown in Figure 5.
Figure 5: Use the Eraser tool to delete some parts of the figure
and use the Line tool to draw a vertical line.
Figure 6: Use the Ellipse and Stamp tools to create two tires.
5. Use the Eraser tool to clean up the horizontal lines inside the circles,
as shown in Figure 7.
Figure 7: Use the Eraser tool to erase the lines inside the wheels.
6. Using the Line, Circle, and Stamp tools, finish the drawing as shown in
Figure 8.
Figure 8: Use the Line, Circle, and Stamp tools to add the finishing touches.
Vector Mode
Let’s now learn how to draw in vector mode. Start by clicking the Paint new
sprite button in the Sprite List area to create a new sprite. The Paint Editor
will start in the default bitmap mode, so click the Convert to vector but-
ton at the bottom-right corner of the Paint Editor. The editor should now
appear as shown in Figure 10.
Toolbar
Current mode
To rotate the object around its center (the small green cir-
cle in the figure), grab and drag the small, gray circle of the
selection box. You can resize the object by dragging any
of the small square boxes around the edges of the object.
When you move the mouse close to the object’s center, the
mouse pointer changes to a hand cursor, which allows you
to move the object around the Canvas. You can also move
a selected object using the keyboard arrow keys.
Click and drag the mouse over multiple objects to select
them all at once. You can also shift-click to add an object
to (or remove it from) a selection. Press the delete key to
delete the selected object(s).
Reshape Use this tool to change the shape of an object. Select the
object you want to reshape, and a set of control points will
appear on the object’s perimeter, as shown below.
Control point
Click and drag
the control points
to reshape the
object.
(continued)
Line A line is defined by the two control points at its two ends.
To draw a line, click the mouse where you want the line to
start and drag it to the endpoint. To create a horizontal or
vertical line, press shift while dragging the mouse.
To draw a curved line, start with a straight line. Then
using the Reshape tool, shift-click anywhere on the line
to create a new control point. Drag the new control point to
create and shape your curve.
Rectangle Use this tool to draw rectangles using the current fore-
ground color. Click to mark the first corner and drag (shift-
drag for a square) until the shape is the size you want. You
can change the fill style (solid or outlined) and the outline
thickness using the buttons in the options area. The resulting
rectangle has four control points, one at each corner.
Ellipse Use this tool to draw ellipses using the current foreground
color. Click where you want to draw the ellipse, and drag
(shift-drag for a circle) to the size you want. You can change
the fill style (solid or outlined) and the outline thickness
using the buttons in the options area.
Text Select this tool, click anywhere on the Canvas, and enter
the text you want where the cursor appears. When you’re
done, click outside the text area. The Select tool will auto-
matically select your text so you can change its size and
orientation.
Unlike text in bitmap mode, vector-mode text can be
edited anytime, even after you exit the Paint Editor. Just
select the text box and edit its contents.
Color Use this tool to fill the interior or the outline of an object.
This works differently from bitmap mode, where the tool
fills connected regions. After selecting this tool, click on the
outline or interior of any object to fill it with the current fore-
ground (or gradient) color.
Back This button is similar to the Forward button, but it moves the
selected object (or group) back one layer. shift-click to send
the object behind all other objects in the drawing.
Group Use this tool to group multiple objects so that they will stay
together if they are moved. Click and drag over the objects
to select them, and then click this button to create the group.
Ungroup When you select a group, this button becomes visible,
allowing you to ungroup the objects.
SHIFT-click
a curved segment
to create a straight segment
1. Draw two black ellipses for the body and the wings, as shown in
Figure 14.
3. Draw an ellipse for the foot. Use the Duplicate tool to create another
copy, and position the two feet as shown in Figure 16. Use the Back but-
ton to send the two feet back so that they appear to originate behind
the body.
4. Use the Ellipse tool to draw circles for the two eyes and the pupils, as
shown in Figure 17.
5. Use the Rectangle tool to draw the beak. Reshape the rectangle as
shown in Figure 18 by dragging the control points.
And there it is—a penguin! What else can you draw with these tools?