- VTFEdit (sorry Linux users)
- Any animated GIF under 35 MB in size
Step 1Visit ezgif.com and use the Splitter to extract your frames. PNG is my preferred format for exporting.
Just drag and drop the GIF to the file select and click Upload.
Step 2Click the dropdown and select Output Images in PNG Format. Then click Split.
Step 3You're done extracting the frames as PNGs. Now we need to import them into VTFEdit for the conversion.
Click the download option and you should recieve a ZIP file containing each frame from the GIF. Extract this ZIP and open the extracted folder in Explorer or any shell/browser of your choice.
Step 4Open VTFEdit.
Go to File > Import.
Go to the folder you put your GIF frames in, and while holding down CTRL, click them in the right order. They should be automatically ordered from first to last, so just click each one from left to right until they are all highlighted.
Then click okay. A dialog will appear asking for import settings.
Copy the settings shown in the screen capture above (except mipmap settings, we don't need those). Then click Ok.
If you did everything right, playing back the texture in VTFEdit using the play button will cause the image to move:
Now to the left side, set the following settings:
No Mipmap - on
No Level of Detail - on
Clamp S - on
Clamp T - on
Point Sample - enable this if your GIF is pixel art
Step 5Time to save our spray.
Make sure you disable auto-generate VMT in the program Options, otherwise VTFEdit will create its own material file which the game may or may not like. TF2 will automatically generate materials for our sprays so making our own VMT isn't necessary unless we need to adjust the framerate (read more about that here).
Now go to File > Save and save your VTF file.
Step 6Open your game, go to multiplayer options, and click Import Spray.
Now navigate to the folder you saved your VTF file and open it. It should automatically be copied into your TF2's spray directory.
And you're done! Try it out!