This short tutorial is an explanation how to make transparent sprays for all Source games that support sprays.

EDIT 9 Sep 2013: Updated all image links to a new location as the old ones were no longer available.

UPDATE NOTE: If you know what you're doing, you can also use transparent (alpha channel) PNG images! Since this tutorial was made, TF2 gained support for larger 512x512 images, that being the maximum size allowed today (2013). This makes the sprays larger and allows for more detail. The creation process is still the same, however.

If you wish to make a non-transparent spray, you can skip steps 9 and 10 when you get to them and just continue with step 11.

In this tutorial Paint.NET is used as the graphics program because it is free and easy to use. Most of the other editors have the same features that Paint.NET has and more, and can easily be used with this tutorial.

Things needed:1. The image you want to make into a spray.2. A graphics editor. You can get several free ones that are suitable, such as Paint.NET, or use a commercial editor that you might have such as Paint Shop Pro or Photoshop (note: If using Photoshop, the required free Targa plug-in is here) 3. VTFEdit, a program by Nem that allows you to create the needed VMT and VTF files. Get it here: http://nemesis.thewavelength.net/index.php?p=41

Preparing your image:

1. Open up the image in Paint.NET

2. This image is 581 by 746 pixels, thusly not a perfect box shape. All Source games demand that sprays are sized in powers of two with a maximum of 512. So, we need to make sure that even shrunken down, we will get a good looking image of 256 by 256 pixels. (NOTE: You can also make a 512x512 image, see note at the beginning.)

3. Go to Image and choose Resize.

4.Because the image is taller than it is wide, we enter 256 as the Height and let Paint.NET calculate the width for us, which results in 199. Make sure you choose Best Quality in Resampling.

Now the image is much smaller. You can see that Paint.NET lists it as a 199 by 256 image now.

5. Now we need to make it a perfect 256 by 256. To do this, go to Image and choose Canvas Size.

6. Here, type in 256 for Height and press OK.

Now you will see the image gained borders on the left and right.

7. Click on the Magic Wand tool.

Adjust Tolerance to about 7%

While holding Shift, click on the two borders. They will be selected like in the image below.

8. Next, go to Edit and choose Invert Selection.

This will select the picture precisely and leave the borders unselected.

9. This part is very Paint.NET specific, but might work in other editors as well. Click on Edit and choose Copy.

Then, click on Edit again and choose Paste Into New Layer.

The image won't change visually, but it will gain a new Layer. Layers are quite a straightforward concept. Imagine cutting an onion into thin slices. So thin you can see through them. If you put something under such a thin onion slice, you can see what's under it. Same applies for Layers, although the effect of transparency can be controlled greatly.

10. In the Layer window, click on the Background layer, then press CTRL+A to select the entire background. Then, press DEL on your keyboard.With the background deleted, our copied picture from step 9 floats ontop of an empty background, creating the transparent effect needed for the game.

At this point it is a good idea to save the image as the editor's native format for backup purposes, you can skip this step if you want.

11. Now it's time to save the image into a format that VTFEdit will understand. Go to File and click on Save.Choose a name for your spray, choose TGA as format and click on Save.

12. When you click on Save, Paint.NET will show you this window. Here is where the make-or-break settings happen for the TGA format.Choose 24-bit and uncheck Compress (RLE).

Choose Flatten when Paint.NET asks you. This is needed because the TGA format does not support layers. However, the transparency will be converted so that it can be used later.

13. You're done with editing your image. It's now ready to be made into a spray with VTFEdit.

And now for part 2 of this tutorial: How to convert your TGA image into a proper spray.

Edit 9 Sep 2013: Updated all image links to a new location as the old ones were no longer available.

1. Open up VTFEdit and click on File and then Import.Choose the .TGA file you made earlier.

2. You will get a screen with several options. Set them exactly as you see in the screenshots below.

When you've set everything, click on OK.

The image will now show up in VTFEdit, probably with black borders. This is normal.

3. Now, in the flags area, scroll down and choose No Level Of Detail. This will keep the spray at a high resolution even if you have low graphics settings in your Source game, making them easy to view.

4. Click on Options and check Auto Create VMT File.

5. Now click on File and Save and give the spray a name, then click on Save.

Since this is mostly a TF2 forum, I'll use TF2 as an example on how to put the sprays into the game properly.

EDIT 9 Sep 2013: Updated all image links to a new location as the old ones were no longer available. Also updated the path to the materials folder as this has changed when Valve introduced SteamPipe.

1. Grab the two files VTFEdit created and copy them to your TF2 Materials folder. This is usually located at \Steam\steamapps\common\Team Fortress 2\tf\materials\VGUI\logos

2. Start TF2 and click on Options.

3. Go to the Multiplayer tab and look for your spray in the list. You do NOT need to Import the spray from the game because you already did that in step 1.This is where you can see if your spray works as intended. You can see the game recognizes the transparency.

4. Click on OK to use the spray and join a game!

Hope this tutorial was useful to you. If you have any questions, feel free to ask.

STrRedWolf wrote:I've found that you do not need to run it through VFEdit; just pick the TGA for the spray in TF2, and it works beautifully.

Running it through VTFEdit with the No Level Of Detail option preserves quality of the image, even if people have low graphics settings. This prevents washed out and blurry sprays. The game doesn't do this on import, hence why the VTFEdit method is preferred.

Seriously, the only difference is that during the 'Import' you select multiple image files. Each file == one frame of the animation.Keep in mind that the max-file-size is still the same as it is for a single image, so optimization of the individual frames is very important.

Now we need to have someone tell how to do the sprays that fade as you get closer.