Guidelines:Animated PNGs
Overview
Animated pngs are similar, but preferable, to gifs that we use on Zelda Wiki. It is recommended that you upload png files instead of gifs as these align with our standard of using png files, which means that people looking for a given file are more likely to find a png instead of a gif. Therefore, pngs are more likely to be used than gifs across the site. Some templates such as Template:Gallery List require images to be in PNG format.
See Category:GIF Sprites for a list of GIFs that need to be converted to animated PNGs.
Creating an Animated PNG
There are methods of creating and converting gifs to pngs. The method that we recommend is with GIMP, an open source image editing program. In this process, we will be creating a gif file and converting it into an animated png.
The first step is to have a sprite sheet of the sprite you wish to animate. A good resource for these is The Spriters Resource. When using images provided by other websites, please be sure to attribute the source accordingly.
The second thing you will need is an understanding of how the sprites are meant to appear in-game. Animated sprites run on intervals of miliseconds, and so they need to be timed accordingly to be convincing and accurate to their in-game depictions. You can either find or make a recording of the sprite playing in motion in-game to assist with this. The most ideal format for this is a video that allows you to advance frame by frame. This way, you can count how many frames a given sprite is meant to appear. (In some advanced cases, some sprite animations use the same sprite texture but change the position of the texture depending on the frame itself.)
Once you know how many frames appear for a given sprite, you can then divide the number of frames by the frame rate of the game to get the milisecond duration the given sprite should play at (rounded up and then multiplied by 1000). For instance, if a given texture plays for 8 frames in a 30 fps game, that comes out to 0.2666...
. After rounding and multiplying, you get 270ms. Sprite textures generally advance at the same intervals, but this isn't always the case.
For this demonstration, we will be animating the idle sprite for Tingle from Cadence of Hyrule. The sprite sheet for this can be found at The Spriters Resource.
There are more sprites than we need from the sprite sheet given, so we need to condense it down to just what we need to work with. For this, you can use the Rectangle Select Tool in the toolbar.
-
Select the boundary of what you need.
-
Then Crop to Content.
We're still not done erasing all of the unnecessary bits, however. If you've downloaded the sprite sheet from somewhere else, you may need to add an alpha channel to make sure that the background won't appear white when you delete it.
-
Add an alpha channel.
-
Select all of the unnecessary background color with the Fuzzy Select Tool and then delete it.
When you're done with this, you should have a set of sprites on a transparent background (represented by a checkerboard pattern). In this example, we have a set of nine sprites that are a maximum of 22 pixels wide and 35 pixels high. These numbers are important as they will be the resolution we will work at when animating all of the sprites together. The maximum size of the gif you are working with should only be what is necessary for the sprite and the animation. Any unnecessary space will affect how the sprite displays, so be sure to find the maximum range of each sprite and go with the largest available.
To get started animating these sprite textures, you should open a new document in GIMP as a work space.
-
Create a new image.
-
Set the dimensions to the exact maximum for your sprites.
-
You may need to delete the background layer if you did not specify to make it transparent in the advanced options.
From here on, it's a matter of assembling all of the sprites in the appropriate order. Luckily, the sprite sheet provided lists all of the sprite textures in order, so all we have to do is copy and paste them from left to right on top of each other in the new document we created.
-
Select the appropriate boundary of the sprite texture. This sprite is one pixel shorter than the maximum, so we will include one horizontal line of blank space.
-
Paste your selection to the new document.
-
If what you paste isn't the base layer of the document, you will need to make sure to add it to a new layer. You can do this by pressing
Shift
+CTRL
+N
, or by clicking the two options in this image. -
When you're done pasting all of the textures, it should look like this. It is subtle, but you can see all of the sprites on top of each other here.
Once you've assembled all of your sprites, it is time to export the image as a gif. Note that specifically for sprites from Cadence of Hyrule, you should ideally time all of the sprites to match 400ms per animation loop. As this animation has 9 sprite textures, that would be 400/9, so roughly 44ms per frame (note that GIMP presently rounds this down to 40ms). This won't necessarily match the animation seen in-game but this is done for uniformity. See below for more details.
-
Start by exporting the image as a gif and name it accordingly. This file will be called
File:CoH Tingle Sprite.gif
-
Your gif should look like this. Do not leave a
GIF comment
and make sure to check theAs animation
box. The delay interval set here is 44ms. Make sure you replace each layer so no other sprites appear on a given layer.
Once you've exported it, you now have a fully animated gif. However, as we're trying to upload an animated png instead, we're not finished. We need to convert the gif to png format. This can be done by visiting a website such as ezgif.com.
-
Upload your gif and convert it.
-
Once it's converted to png, save it and then upload it to Zelda Wiki.
-
Here is the completed image.
Note: because of the nature of the game, files from Cadence of Hyrule uploaded at an interval of 400ms/loop may not match their in-game counterparts. This is intentional, as it keeps images in our galleries uniform. They are set to match the speed of the field area of Cadence of Hyrule so that they all move in unison.
-
Trill sprite
-
Adapted speed
(44ms) -
In-game speed
(Various ms)