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
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.