Turn a sprite sheet into a GIF

Updated · Adib Khan

A small pixel-art character walking, the animation that the four-frame sheet on this page holds
The Walk starter. Its four frames are the practice sheet on this page. Open it in the editor.

What you need

A sprite sheet is one picture that holds every frame of an animation, laid out on an even grid. The cells are all the same size, and they run left to right, then top to bottom. That is the layout most tools and engines write, and it is the one PixelFlipbook cuts.

You need a PNG of the sheet, and you need to know the size of one cell. If the sheet is 64 pixels wide and holds four frames in a row, a cell is 16 pixels wide. When PixelFlipbook recognises the sheet it guesses the cell size and shows the grid over your picture before it cuts anything, so a wrong guess is easy to spot.

No sheet to hand? Save this practice sheet. It is the four frames of the Walk starter in one row, 64 by 16 pixels, made by the editor's own sheet export. The steps below use it.

Limits are generous. A frame can be up to 512 pixels on a side, and a project holds up to 256 frames. A sheet larger than 512 pixels on a side can only be opened as a sheet, because it is too big to be one frame.

One thing to know before you start: the cut dialog does not appear for every PNG. It appears when the picture looks like a sheet, and otherwise the PNG opens as one frame. The next section says what counts.

Open a sprite sheet and make your first GIF.Open the editor

Which sheets are recognised

PixelFlipbook offers to cut a PNG that you open on its own, with no JSON file, when one of these is true:

Anything else opens as a single frame, with no dialog, unless you ask for the dialog yourself (see below). That includes a square sheet under 256 pixels (64 by 64, 96 by 96 and 128 by 128 all get no dialog), a strip whose cells are not square, and a sheet whose sides do not divide into one of those cell sizes. A GIF or any other image that is not a PNG skips the dialog too. A strip of square cells is always recognised, whatever their size, because its width is an exact multiple of its height. A strip of cells that are not square, such as 64 by 24 with cells 16 wide, is not recognised automatically.

Not recognised? Ask for the dialog. You do not have to rearrange the picture. In File, Open file, press Open as sprite sheet and choose the PNG. The cut dialog appears for every PNG you choose, whatever its size or shape, and you type any cell size you like. It also works for several files at once. If you dropped several files together, each PNG that opened as one picture has its own Open as sprite sheet button in the list. And if a picture is already open as a single frame, Cut this picture into frames in the same dialog takes what that frame shows, with its visible layers flattened into one picture, and opens it in the cut dialog. The result is a new project; the project you started from is left as it was. A 64 by 64 picture of sixteen cells of 16 gets no automatic dialog, and all three routes open one.

Dropping several files at once does not show the cut dialog by itself, so use one of those buttons for each sheet.

Steps

  1. Open the file. In the editor choose File, then Open file (Ctrl+O, or Cmd+O on a Mac). You can also drop the PNG anywhere on the window.
  2. Choose Spritesheet. When the picture is recognised as a sheet, the dialog asks whether it is one picture or a sheet. Pick Spritesheet. If you pick One picture, the whole image becomes a single frame. If no dialog appeared, use Open as sprite sheet, described above.
  3. Enter the cell size. Type the cell width and height, or the number of columns and rows, and the other pair follows. Add padding if there is a gap between cells, and a margin if the grid sits inside a border. A line under the fields says what you will get, for example "4 frames of 16 x 16", and the preview draws every cell outline over your picture.
  4. Press Import. The sheet opens as a new project named after the file. Your other projects are not touched.
  5. Check it plays. Press Play, or Space. If the frames jump, the cell size is probably a pixel or two off, and you can open the file again with new numbers.
  6. Export. Choose File, then Export, then the GIF tab, and press Export GIF.
The Open file dialog in PixelFlipbook with the Spritesheet option chosen, a four-frame walking sheet with a red grid over it, cell width 16 and cell height 16, and the line 4 frames of 16 by 16
The cut dialog. The red outlines are the cells that will become frames.

If a few pixels are left over at the edge, the line says "Spare edge pixels are left out", so you know the sheet was not an exact multiple of the cell size. The Import button stays greyed out, with the reason, when the numbers leave no room for even one cell.

Set the timing

A bare PNG has no timing in it, so every frame opens at 100 ms, which is ten frames a second. That is a fair start for a walk and too fast for most idles.

The box labelled Duration beside the timeline sets the time for the frame you are on. To set several at once, tap the first frame, shift-tap the last, and use the clock button in the bar that appears. The dialog takes milliseconds or frames per second, and each field fills in the other. Times run from 10 to 65535 ms.

The PixelFlipbook editor right after importing the sheet: the first walking frame on the canvas, four thumbnails in the timeline each marked 100 ms, and the file name walk-sheet-64x16 in the title
Right after the import: four frames, 100 ms each, the project named after the file.

If your sheet came with a JSON file, skip this step. Drop the PNG and the JSON on the editor together. The JSON says where each frame sits and how long it shows, and PixelFlipbook reads that instead of asking you for a grid. This works with the JSON written by PixelFlipbook's own sheet export and with the JSON Aseprite writes, in either the array or the hash layout. Tags come across as tags. The Aseprite JSON guide lists the fields.

Export the GIF

The GIF tab shows a live preview of the animation. Below it you choose:

The PixelFlipbook Export dialog on the GIF tab: a preview of the walking character, the Scale control set to times eight, background swatches with Transparent chosen, the line 4 frames, 128 by 128 pixels and the Export GIF button
The GIF tab. The line above the button tells you the frame count and the size of the GIF in pixels before you export.

The GIF loops forever and plays every frame, in order, once through. Tags and ping-pong directions are not used by the GIF, so if you want a back-and-forth, add the return frames to the timeline first. The format counts time in steps of 10 ms and browsers play nothing faster than 20 ms, so a frame time can move a little. A note in the dialog says so when it does.

Want a different shape of file? The same dialog exports a PNG, a new sheet with JSON, a video, or a Godot bundle. The sprite sheet guide covers layouts and padding.

Tips

Prefer to draw the frames yourself first? The walk cycle guide builds the practice sheet from scratch.