Make the sheet
- Open the GIF to sprite sheet converter and drop your GIF — say
fox_run.gif. It runs in your browser; the GIF isn’t uploaded. - Tick Aseprite JSON under the data files. JSON (Hash) is ticked already; keep it if you also want single frames.
- Download the ZIP:
fox_run.png,fox_run.jsonandfox_run.aseprite.json. The files and the animation are named after the GIF; change File name or Animation name first if you want other names.
Load it in Phaser 3 or 4
// preload
this.load.aseprite('fox', 'fox_run.png', 'fox_run.aseprite.json');
// create
this.anims.createFromAseprite('fox');
this.add.sprite(100, 100, 'fox').play({ key: 'fox_run', repeat: -1 });createFromAseprite makes one animation per tag in the file — here fox_run, the animation name — with every frame’s own duration. We ran this exact code in Phaser 3.90 and 4.2: six frames at 120, 70, 70, 90, 70 and 140 ms, as in the GIF.
Only need still frames? Load the JSON (Hash) instead: this.load.atlas('fox', 'fox_run.png', 'fox_run.json'), then this.add.sprite(100, 100, 'fox', 'fox_run_000').
What happens to the GIF’s timing
- Every frame keeps its own delay: a pose the GIF holds for 140 ms stays 140 ms.
- Identical frames in a row are merged into one frame that lasts as long as all of them, so the sheet is smaller and the animation looks the same.
- Keeping every 2nd or 3rd frame doesn’t speed the animation up: the skipped frames’ time goes to the frames you keep.
- Delays of 0 or 10 ms count as 100 ms, which is what browsers do with them, so the sheet plays like the GIF you saw.
Several animations in one sheet
Got idle.gif and run.gif? Add both to the Sprite Sheet Maker: each becomes its own animation on its own row, in one PNG and one data file, and createFromAseprite creates idle and run at once. With several animations the files are called spritesheet unless you change File name.
If the animation looks blurry
For pixel art, add pixelArt: true to the game config so Phaser doesn’t smooth the frames. Fix Blurry Pixel Art has the setting for Phaser and other engines.
FAQ
What is the animation key?
The animation name, which starts as the GIF’s file name: fox_run.gif gives fox_run. Change Animation name before downloading to pick another.
Do I need a plugin?
No. this.load.aseprite and this.anims.createFromAseprite are part of Phaser 3 and 4.
Which Phaser versions does this work in?
We run the code on this page in Phaser 3.90 and 4.2.
Is it free? Is my GIF uploaded?
It’s free, with no sign-up and no watermark, and the GIF is converted in your browser.
More free tools
- GIF to Spritesheet — the converter this tutorial uses
- Sprite Sheet Maker — several GIFs or PNG frames in one sheet
- Fix Blurry Pixel Art — the smoothing setting in Phaser and other engines
- GIF to Frames — save every frame of a GIF as its own PNG, with the delays
- Sprite Sheet Cutter — split a sheet back into PNG frames, or get its data file