Animate drawings with Pencil2D
Tutorial – Pencil2D
Pencil2D, an easy-to-use painting and 2D animation program, lets you create small animations quickly. Despite the simple user interface, you might need a little help getting started.
If you want a hand-drawn ball to drop elegantly from the ceiling in a YouTube video, Pencil2D [1] is the program for you. Thanks to this drawing program, artists can do more than just paint pretty comic figures, balls, or other objects on virtual paper; they can also animate these objects. If required, the tool imports bitmap images or photos for use as backgrounds.
Pencil2D is primarily intended for cartoon artists, but the software also lets you quickly create animated illustrations or diagrams. All you have to do is add a little of your own artistic talent. An impressive YouTube video [2] shows what professional animators have created with Pencil2D. The program is licensed under the GPLv2; the source code is available from GitHub [3].
Some distributions have Pencil2D in their repositories. Arch Linux users will find the tool in the pencil2d package in the Arch Users Repository (AUR). On current Fedora systems, you can fetch and install the package by typing:
sudo dnf install Pencil2D
Debian and Ubuntu users install the pencil2d package at the command line with:
sudo apt install pencil2d
If the animation program is missing from your distribution's software manager, or if you only find an older version stored there, you can use a Flatpak or AppImage package – most current distributions now support both formats. Pencil2D's Flatpak package is available from the Flathub repository. To retrieve and install it from Flathub, use the first two commands in Listing 1; the third command starts the animation program.
Listing 1
Installing the Pencil2D Flatpak
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo $ flatpak install flathub org.pencil2d.Pencil2D $ flatpak run org.pencil2d.Pencil2D
The AppImage is available directly on the Pencil2D website [1]. Click on Download, and then select the Current Stable Version. Below the penguin icon, select the version that matches your distribution. Then make the downloaded file executable (Listing 2) and launch it.
Listing 2
Installing the Pencil2D AppImage
chmod +x pencil2d-linux-amd64-<Version>.AppImage
Start Drawing
When launched, Pencil2D opens the main window shown in Figure 1. In the center, you can see the empty drawing area. In the top left corner, you'll find the drawing tools. The pencil draws thin lines; the brush makes thicker lines.
If you need a straight line, select the Polyline tool, the button that resembles an "M" (Figure 2). The first mouse click defines the starting point; clicking again adds a section. Double-click to end the drawing process. The eraser does pretty much what you would expect; the index finger smudges the area under the mouse pointer when you press the mouse button. The garbage can clears the complete drawing area without prompting.
When painting, a grid can be placed over the drawing area using View | Raster. You determine the size of the individual boxes under Edit | Preferences | General | Grid section. To zoom in or out of the drawing, use the mouse wheel, or hold down Ctrl while pressing the up or down arrow key.
In the Color Box window, you can define the drawing color (Figure 3). First select the base color from the wheel and then choose the brightness from the inner square. Alternatively, click RGB and use the sliders to mix the three basic colors (red, green, and blue). To avoid having to define a color time and time again, you can add the color by pressing the plus symbol next to the Color Palette. Pencil2D automatically gives the color a name, which you can change by double-clicking on it. You can then select a color from the palette with a single click.
Moving Images
Using the timeline at the bottom, you can breathe life into your drawing. Pencil2D relies on the flip-book principle. An animation consists of a sequence of individual images that the tool somewhat inconsistently also refers to as keys. The following example of a ball dropping demonstrates how quickly an animation can be created in Pencil2D in this way.
First draw a circle at the top of the drawing area. We now want the ball to slowly drop. To do this, create a new frame by selecting Animation | Add Frame or by pressing the F7 key. You will now see a new empty drawing area, while the vertical red mark moves one position to the right in the timeline.
Using the . and , keys allows you to jump back and forth between the existing images. In the top line of the timeline, Pencil2D numbers the images consecutively. If you click on a number there, you are taken directly to the matching single screen. The Zoom slider lets you expand the timeline's width on screen and thus simplify navigation. In any case, the red bar marks the image you are currently viewing and editing in the drawing area. Make sure Pencil2D displays the second frame you just created and the new empty drawing area.
Onion Skin
To drop the ball, draw another circle slightly below the first one. This is not so easy since you can't see the ball from the first picture. To change this, you can press O, go to View | Onion skin | Previous, or click on the second button from the right in the top line under Display (see Figure 4).
Now, the first image appears, colored light gray, in the drawing area. Pencil2D refers to this image as the onion skin. To make it more obvious that this is the ball from the previous image, you can color it red by clicking on the icon with the red box under Display. Now draw a new ball slightly below, which is colored black, as shown in Figure 4.
Repeat this procedure until the ball arrives at the bottom of the drawing area. To make your work easier, click on the Select tool (with the dashed rectangle) and draw a frame around the ball. You can grab the selection using the handles at the corners.
Select Edit | Copy to create a new frame. The selection rectangle should appear automatically. Move the mouse pointer into the rectangle until it turns into a circle. Now move the box a little to the right using drag and drop. Then use Edit | Paste to insert the copied circle at exactly the position shown in Figure 5. You can unselect by clicking anywhere on the drawing area.
When fine-tuning more complex animations, you will often need a preview of the following image. To do this, simply click on the second symbol from the right in the bottom line on the left side under Display. The following images are now displayed as grey shadows. To help distinguish them, you can color them light blue, as shown in Figure 6, by clicking on the blue square icon under Display.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.
-
CachyOS Adds Support for System76's COSMIC Desktop
The August 2024 release of CachyOS includes support for the COSMIC desktop as well as some important bits for video.
-
Linux Foundation Adopts OMI to Foster Ethical LLMs
The Open Model Initiative hopes to create community LLMs that rival proprietary models but avoid restrictive licensing that limits usage.
-
Ubuntu 24.10 to Include the Latest Linux Kernel
Ubuntu users have grown accustomed to their favorite distribution shipping with a kernel that's not quite as up-to-date as other distros but that changes with 24.10.