Free · runs in your browser · nothing is uploaded

Animated GIF to VTF Spray Maker

Drop an animated GIF and get an animated .vtf spray (plus its .vmt) that stays under the 512 KB spray limit. The tool keeps as many frames and pixels as fit, drops or shrinks only when it must, and shows the final file size before you download. It runs in your browser, so the GIF is never uploaded.

Loading the GIF to VTF spray maker...

How to make an animated spray from a GIF

  1. 1

    Drop your GIF

    Pick any animated GIF. Every frame is decoded on your device with its own delay, transparency and disposal, exactly as a browser plays it.

  2. 2

    Choose size and format

    Pick the spray size (512, 256, 128, 64 or 32 px) and DXT5 for transparency, DXT1 for the most frames, or BGRA8888 for lossless colour.

  3. 3

    Let it fit under 512 KB

    With the limit on, the tool picks frames and size so the VTF is at most 524,288 bytes. The final size and a bar against the limit show before you save.

  4. 4

    Download and install

    Save the spray ZIP and unzip it into your game folder (it has materials/vgui/logos already), or import the .vtf in the game's spray menu.

How many frames fit in a 512 KB spray

A VTF stores every frame at full size, so the frame count depends on the size and the format. These are the most frames that fit with mipmaps off (an 80-byte header and a tiny thumbnail included).

512 x 512, DXT51 frame (256 KB each). Big sprays are still images; for animation go smaller.
512 x 512, DXT13 frames (128 KB each), no transparency.
256 x 256, DXT57 frames (64 KB each), with smooth transparency.
256 x 256, DXT115 frames (32 KB each), no transparency or 1-bit only.
128 x 128, DXT531 frames (16 KB each).
128 x 128, DXT163 frames (8 KB each): the choice for long GIFs.
BGRA8888Lossless, 4 bytes per pixel: 256 x 256 fits 1 frame, 128 x 128 fits 7.
OutputA multi-frame VTF 7.2 with clamp and no-LOD flags, an UnlitGeneric VMT with the AnimatedTexture proxy, and a menu VMT, in one ZIP.

Example: fitting a 24-frame GIF into one spray

A test GIF of 24 frames (an orange ball going round once) run through two of the fit settings, with DXT5. Green frames go into the VTF; faded frames are left out. The chequered area is transparent. The byte counts are the tool's own sums for these settings.

All 24 frames of a test GIF marked green: in Auto mode every frame fits in a 128 x 128 VTF spray
Auto: balance size and frames. 512 x 512 holds 1 frame and 256 x 256 holds 7, so the tool picks 128 x 128 and keeps all 24 frames: 393,424 bytes, under the 524,288-byte limit.
Seven of 24 test GIF frames marked green, evenly spread: what fits in a 256 x 256 DXT5 spray under 512 KB
Keep the size, drop frames, at 256 x 256: 7 of the 24 frames fit (frames 1, 4, 7, 11, 14, 18 and 21), evenly spread over the loop: 458,960 bytes.

Why animated sprays have a 512 KB limit

Source games send your spray to every player on the server, so they refuse spray files over 512 KB. A GIF compresses frames against each other, but a VTF cannot: each frame is stored whole. A 40-frame GIF of a few hundred kilobytes can turn into many megabytes as a VTF, which is why most spray makers ask you to cut frames by hand.

This tool does the maths for you. In Auto mode it keeps at least half the frames (all of them for short GIFs) and picks the largest size that fits. Keep the size drops frames evenly across the loop, so the motion stays smooth; Keep every frame shrinks the spray instead. You can also turn the limit off for a texture that is not a spray.

Keeping the speed of the GIF

When frames are dropped, the remaining frames are spaced out across the same loop, and the frame rate written to the VMT is lowered to match, so one loop takes as long as it did in the GIF. You can also set a fixed rate. Some games play sprays at their own speed for other players, so check it in game.

Installing the spray

In Team Fortress 2 and most Source games, open Options, then Multiplayer, and import the .vtf as your spray. To install it by hand, unzip the spray ZIP into the game folder (for example tf/ or garrysmod/): the VTF and VMT go to materials/vgui/logos and the small VMT in UI/ lets the menu show it. Pick it in the spray list and set your spray key in the keyboard options.

A VTF spray converter for TF2, GMod and L4D2

A VTF spray converter turns a normal picture into the .vtf texture that Source games use for sprays. This one takes GIFs: an animated GIF becomes a looping spray, and a one-frame GIF a still one. For a still PNG or JPG, the PNG to VTF and JPG to VTF converters below do the same job with more texture options.

The spray file is the same for every Source game; only the folder you unzip it into changes: tf/ for Team Fortress 2, garrysmod/ for Garry's Mod, left4dead2/ for Left 4 Dead 2, cstrike/ for Counter-Strike: Source and hl2mp/ for Half-Life 2: Deathmatch. You can also skip the folders and use Import Spray in Options > Multiplayer to pick the .vtf.

As a TF2 spray maker, size is the main choice. Under the 512 KB limit, 256 x 256 gives you up to 7 frames with soft transparency or 15 without it, and 128 x 128 gives up to 31 or 63. Short loops look best at 256; long reaction GIFs keep more of their motion at 128.

Need a new model or texture for your mod?

Make a 3D model from a photo or a short text prompt with AI, or generate a seamless texture, then bring it into your Source or GoldSrc project with these free converters.

More free Source texture tools

GIF to VTF spray questions

Drop the GIF on the box above, pick a spray size and format, and press Download. The tool decodes every frame, resizes them to a power of two, fits them under 512 KB and writes an animated VTF with a matching VMT. Nothing is uploaded.
VTF frames are stored uncompressed against each other, so each frame costs the full size. Use 256 or 128 px, DXT1 if you do not need transparency, or let the Auto fit setting drop frames. The final size is shown before you download.
Yes with DXT5 or BGRA8888. Transparent GIF pixels become transparent in the VTF. DXT1 has no smooth alpha, so pick DXT5 for sprays with soft edges or a see-through background.
Source engine games: Team Fortress 2, Garry's Mod, Counter-Strike: Source, Left 4 Dead 2, Half-Life 2: Deathmatch, Day of Defeat: Source and other mods on that engine. CS2 and Dota 2 run on Source 2 and do not use VTF sprays.
Usually no. Mipmaps add about a third to the size, which costs frames under the 512 KB limit. Sprays are seen from close up, so the tool leaves mipmaps off by default.
Yes. A GIF with one frame gives a still spray. For still PNG or JPG images with more texture presets, use the PNG to VTF converter.
Yes. It makes Team Fortress 2 sprays from GIFs, animated or still. Import the .vtf in Options > Multiplayer, or unzip the spray ZIP into your tf folder. The same files work as a Garry's Mod, Left 4 Dead 2 or Counter-Strike: Source spray.
Since a 2021 update, Team Fortress 2 hides other players' custom sprays unless each player turns them on in Advanced Options, and a server can turn custom spray uploads off. Your spray must also be at most 512 KB; this tool shows the final size before you download.
The file must be 512 KB or less, and the sides must be a power of two (the tool resizes for you). A still spray fits at 512 x 512 in DXT5. For an animated Garry's Mod spray, 256 x 256 holds up to 7 frames with transparency and 128 x 128 up to 31.

Valve, Source, Garry's Mod, Team Fortress 2 and Counter-Strike are trademarks of Valve Corporation, named only to describe file compatibility; The3DAI is not affiliated with or endorsed by Valve.