Team Fortress 2

Team Fortress 2

Not enough ratings
How to Make your own Animated Sprays Using VTFEdit W/O using Editing Software
By alexrox360
Technical Difficulties with GIMP? Don't want to fork over 5$ to use Photoshop? This guide will help players make their own Animated Sprays and make the process simpler and faster to produce them.
   
Award
Favorite
Favorited
Unfavorite
Introduction/Purpose of this Guide
First off, I'd like to make it clear that I am making this guide as a sort of alternative solution to this guide made by GreenSwede. If you can work well with Gimp or Photoshop, you're welcome to try her guide out.
https://steamcommunity.com/sharedfiles/filedetails/?id=1288408087
I wanted to make this guide because I was looking at GreenSwede's guide about how she made Animated Sprays using VTFEdit and a couple other programs. When I tried doing it, I ran into several problems with the programs to the point where I decided to just make my own version. Looking into the guide, I found a couple parts where I figured I could reproduce them with a trusted website I found, and fill in the rest with VTFEdit.

Here is a Visual Representation of my guide.


Requirements
You're going to need an Application downloaded and a couple websites bookmarked to get started with this guide.
  • VTFEdit This is a converter that can turn Images into VTF files that Source games like TF2 can read and use. Since the original site the download was hosted on disapeared, we'll use the same version from Moddb.com, which hosts mods for games and Editing tools.
  • ezgif.com This is a Website that has most everything that Editing Programs have, Including turning mp4 to gif, cropping, splitting layers and Virus-Free!
  • https://ytmp3.cc/en13/ This is a converter that can turn Youtube videos into mp3 (audio only) and mp4 (Video) files. It's really useful when Micspamming on servers.
As well as the Programs, you will also need a couple things ready on your end to start.
  • A Gif/Video you would want to see in TF2
  • A sorted library in Windows Explorer to store your sprays
If you plan on using a Video from YouTube, skip to the Using Youtube to Mp3 now.
If you plan on using a Video/gif from Reddit, skip to the Pulling videos/gifs from Reddit chapter now.
If you already have a gif or video ready, skip to the Resolutions and File Sizes for further instructions.

Come back to the Resolutions and File Sizes chapter after you are done in the other ones.
Using Youtube to Mp3
If your video that you want to turn into a gif is coming from YouTube, you will have to process the video through a site called https://ytmp3.cc/en13/ before sending it to ezgif.com.

https://ytmp3.cc/en13/, or Youtube to Mp3, is a website that explains itself, it converts YouTube links into Mp3 or Mp4 formats to download.


When you have a video you would want to see as a gif, or a specific part of the video, copy the link by highlighting it and using Ctrl+c at the top of the page.


Then go to Youtube to Mp3 and insert the link into the URL box by using Ctrl+v.
Select "Mp4", and then hit "Convert".


It may take a little time to process depending on how long the video is, but when it is done, hit "download" IN THE BLUE BOX and transfer your video to a folder you made for putting them in.


Now you can go back to the Resolutions, File Sizes and Formats chapter of this guide.
Pulling gifs/videos from Reddit
(If you have any other sites that you would want to have videos pulled from along with a virus-free way to download them let me know in the comments)

Even though some videos have a way to download them onto your computer, other videos may not have that feature. In this portion of the guide you will learn how to pull media files from Reddit/Twitter.

How to pull videos/gifs from Reddit

Reddit (/ˈrɛdɪt/, stylized in its logo as reddit) is an American social news aggregation, web content rating, and discussion website. Registered members submit content to the site such as links, text posts, and images, which are then voted up or down by other members.
(wikipedia.org)

With gifs, you can right-click the gif and hit "Save Video As..." to download it.


With Videos, it is a tad more complicated. You can't just right-click on them, so how do you download them? There is a robot called u/vredditdownloader that can process and give download links for the video.


To get the bot to process the video, make a comment under the video and type u/vredditdownloader.
In order to do that, you will also need to get a Reddit account.


Some subreddits have a bot that automatically does this for each video, so you may not have to make an account.


Now you can go to the Resolutions, File Sizes and Formats chapter of this guide.
Resolutions, File Sizes and Formats
When making gif files, it is important for the files not to exceed 512 KB or else they will not work in game. Valve limits the VTF file sizes to 512 KB, so anything over that ammount will not work in-game.

Even if you keep the gif under 512 KB through ezgif.com, there will be times where it will not work in TF2 because of it's file increase in VTFEdit. I've run into many scenarios like this.

It is important to know how many frames you can use depending on the file's resolution and Image format in VTFEdit.

The four formats we will use are DXT1, DXT5, BGR888 and BRGA8888.


The DXT formats you will find, DXT1 and DXT5 are in the compressed formats group. This means they are the best option if you are gunning for the maximum ammount of frames or resolution size in your gif. Color depth is slightly decreased, but the compressed size of the file hides it well.

The other formats, BGR888 and BRGA8888, are in the decompressed formats group. They are most useful for files with less frames and smaller resolutions. It inflates the size of the file, but it has the best VTF spray quality.

The four tables below (made by Greenswede) go through the common image formats and will help you judge how many frames you can keep + resolution size depending on the file format.

The Alpha Format box underneath the Normal Format box is used for transparent images. For making gifs, just set the Alpha Format to the same format as the Normal Format. Even if you don't set the Alpha Format, VTFEdit will detect whether the image has transparency compatibility or not, and set it for you. You can always check what format the VTF file is in by looking at it's Info tab on the sidebar.


Warning: These tables do not include Mipmaps! Uncheck the box in VTFEdit to turn them off. Don't use them in making gifs or it will inflate the file size more!


DXT1
Resolution
Frames
File Size
64x64
255
510 KB
128x128
63
504 KB
256x256
15
480 KB
512x512
3
384 KB

DXT5 (Alpha)
Resolution
Frames
File Size
64x64
127
508 KB
128x128
31
496 KB
256x256
7
448 KB
512x512
1
256 KB

BGR888
Resolution
Frames
File Size
64x64
42
504 KB
128x128
10
480 KB
256x256
2
384 KB
512x512
0
768 KB

BGRA8888 (Alpha)
Resolution
Frames
File Size
64x64
31
496 KB
128x128
7
448 KB
256x256
1
256 KB
512x512
0
1024 KB
(Added note that 64x64 is really low quality, so try not to use it on gifs with words.)

Why am I telling you this now? You need to know this before heading into the next chapter because you want to have a general Idea of what Image format you will use with your image depending on it's size.
Using ezgif
Assuming you already have a Gif file ready, we'll start with using ezgif.com to resize gifs into a form under 512 KB.

ezgif.com is a media converter website that can alter our mp4/gif files to convert mp4 files into gifs, resize them to fit the requirements, and split them into layers to be used in VTFEdit.


if you have a gif ready, skip to the Resizing a Gif section now.

Converting a Video to a Gif
Let's start with getting your image converted. If your file is in a Video or MP4 format, you will need to convert the file to a gif format.

Go to Video to Gif on the toolbar, choose your video file from the computer and hit Upload Video.


It may take a little time to process depending on how long the video is, especially if it is longer than 10 minutes. Here's the important part. When you have the video loaded, you will get a miniplayer of the video, where you can edit when the gif portion of the video begins and ends.


Edit your video down by using the button controls and the video scroller, until you are happy with what you have.
Download the video by hitting the Save button, and go to the Resize tab on the toolbar.


Resizing a Gif
From the Choose File box, select your newly made gif or pre-existing gif and upload it.

From here, we can preview what the gif looks like, along with boxes that we can resize our gif with, and resizing options. Don't be frightened of your gif size. It will get smaller when we resize it.


Looking at the Frames Per Seconds, and the tables in Resolutions and File Sizes, pick a format (we will use it in VTFEdit) that closely matches what you plan on making your file size, whether it be a big or small gif. Then, match up your Frames per second on your gif to the nearest fps value in the table. Then, you will have your Resolutions that you will set on your gif.


(In some situations where the gif is too big to fit the resolution, you can round up to the smaller resolution and use that as a substitute)

Now that you have the right Resolution for your gif, put it into the boxes for height and width. Set the Resize Method to "Gifsicle" and the drop-down menu for If Aspect Doesn't Match to "Stretch To Fit" and hit Resize Image!


Hit the Save button when you are done, and go to the Gif Splitter tab in the toolbar.

Splitting your Gif into Layers

Choose your New Resized gif from the Choose File box, and upload it.

From here, we can see our gif, and a drop-down menu for optimizations. You're probably asking, "Why do we need to split the gif?" "Wouldn't it be easier to just put it into VTFEdit as it is?" VTFEdit can't properly convert gifs unless it comes in a layered form. It is just how it works.


You shouldn't have to mess with the drop-down menu, it's already on the best setting, Redraw From Previous Frames. The other options make it look glitchy, so just use the default, and hit Split to Frames!

After splitting it, you will get a preview of all of the layers/frames in the gif. Hit Download Frames as Zip to save it. Put the Zip file into your designated folder with the other saved gifs, and extract it to there. Then proceed to VTFEdit.

Using VTFEdit
Now that you have a layered gif ready, it's time to move on to VTFEdit.

VTFEdit is a file converter that can turn Jpeg files or images into high-quality VTF or Valve Texture Format files.

Opening VTFEdit up, we have a window where we can see our loaded image, and a sidebar for adjusting the settings.


To put your file into the converter, go to Import icon in the top left corner of the app, then browse until you find your layered version of your gif. Then drag your mouse over all of your layers to put it into the converter.


An options screen for your layered gif will come up. If you remember which Format you planned on using with your gif in the previous chapter, set it to that format from the drop-down menu. Set the Alpha Format to the same as your Normal Format. It shouldn't matter what you set your Alpha box to, because Alpha is only used when making Transparent sprays. VTFEdit should detect whether a spray has any compatibility for Alpha, and you can check what type of spray it is in the Info tab after you have put in your spray.

Set the Texture Type to Animated Texture.The other 3 boxes should stay unchecked, Normal Map, Mipmap and Resize.


If you did everything correctly so far, you should see your active gif in the preview box.


It will notably move a lot faster than in-game. Unfortunately, the in-game sprays can only run at 5 FPS. I believe it's a limitation of the TF2 hardware, but it could be other reasons. Nevertheless, plan your gifs accordingly!

If your gif looks small in VTFEdit (64x64), don't worry. It will scale to fit the normal spray size in game. If it is still too big, you can also cut out unneeded frames of the gif.

In the Top Left corner, you can see the different tabs you will work with in the program.
  • File System lets you browse your computer files, and import files into VTFEdit.
  • Image lets you preview your gif, and toggle it's flags.
  • Info lets you see the size of the gif, how many frames it has, and what format it is.

Another important part of VTFEdit is the Flags in the Bottom Left corner of Image. Here are some of the most common ones we will go over.
  • No Mipmap (Should be enabled already because we didin't include it in the last step.)
  • No Level of Detail (Your spray will not be affected by other people's Texture Quality options.)
  • Clamp S (Used for sprays that are Transparent, the Clamp S coordinates)
  • Clamp T (Used for sprays that are Transparent, the Clamp T coordinates)
  • Point Sample ("Pixel Art" Texture Filtering, Best used with Pixel art, or sprites.)

Once you have your FPS, File Size and Resolution in order, hit the Save icon and name your file to save it!
Putting your VTF file into TF2
Now that you're in the home stretch of the guide, it's time to put your VTF file to the test! putting it in TF2!

TF2 dosen't need an introduction sincve you all have to know something about TF2 to find this guide, so let's just skip to the importing.

On the main menu, go to Settings>Multiplayer>Spraypaint Image and hit "Import Image".


From here, just browse your computer untill you find your VTF file and open it. If successful, it should open in your preview window in Settings!

Now you can join a community server and spray with ease!
Congratulations!
(If you need help troubleshooting or want to give more Media>gif websites, I'll try to respond as fast as possible in the comments.)

Congrats on making it this far in the guide! Thanks for checking my guide out, and I hope this was as helpful as it could be.
1 Comments
11/10 would cook spider again Jan 24, 2022 @ 6:26am 
Concise and doesn't take a genius to follow. Contains plenty of tips no other spray tutorials have. ezgif works wonders.