Team Fortress 2

Team Fortress 2

592 ratings
Creating Transparent Sprays
By Jimo
I will explain how to create a transparent spray for Team Fortress 2. This technique can also be applied to other Source games that allow sprays. For this guide you will require Adobe Photoshop, GIMP or PAINT.NET and VTFEdit.
This guide will explain how to create a transparent spray for Team Fortress 2. This technique can also be applied to other Source games that allow sprays.

What You Will Need
Before we get started you are going to need a few tools so you can follow along with the guide.

You will need some form of image editor. In the guide I will be using Adobe Photoshop CS5 but other revisions of the program should work just fine. You can use GIMP or PAINT.NET as a free alternative to Photoshop as well.

Additionally you will need VTFEdit (Valve Texture File Editor) which is a tool used to convert your image in to the game world. I have provided links to all of the required software below.

Getting Started
Before we start making our spray we will need to find an image that we want to use. The end goal is to create a spray which has no background so it looks similar to graffiti when it's sprayed in-game.

The image will need to be re-sized to either 512 by 512, 256 by 256 or 128 by 128 pixels so keep that in mind when making your selection. Images which are either too wide or too tall typically will not work as well.

If you are an artist you can create your own design and follow the steps in the guide to get the same transparency effect.

For the tutorial I will be using an image I took of myself. Feel free to use it if you like!

Removing the Background
Open up your image editor and import the image you want to use on a new layer, separate to the background.

Select the Pen Tool.

Carefully draw around the parts you want to use in your spray. If you would like to learn more about how to use the Pen Tool properly, you can follow this nice tutorial by Melissa Evans here.[]

Once you have finished with the pen tool you will need to locate the path menu. By default in Photoshop it should show up as a tab next to Layers and Channels. If you don't see it go to Windows > Paths.

When you have the Paths menu up you will see something called "Work Path". Simply right click on this and choose Make Selection.

Once you click on Make Selection a popup box will appear in the middle of your page. The default settings should suffice, so simply go ahead and click on Ok.

The parts that you want to appear in the spray should now be selected.

Right click on the selected area and choose Select Inverse. This should now make the area outside of the cut out selected. All you need to do now is simply hit Delete on your keyboard and you should end up with something like this.

If the background doesn't delete and a popup window comes up instead, it is more then likely because you didn't create a new layer for your image.

You are now ready to proceed to the next step!
Resizing the Spray
If you are like me and find doing detailed cut outs of larger images easier, you will now need to resize your spray. You are able to use the following sizes in TF2:

  • 512 by 512 pixels
  • 256 by 256 pixels
  • 128 by 128 pixels

If it's already one of those sizes, you can skip ahead. If not, keep reading.

For this guide I will be using 256 by 256. Open up a new 256 by 256 pixel image and set the mode to transparent.

Open up the large cut out version and drag and drop the layer on to smaller image you just created. I've highlighted the tools you will need to use to do this below.

You should now have a very large image in your small canvas. Click on the Move Tool and make sure you have Show Transform Controls checked at the top. Once this is turned on you will see some areas around the image that you can use to resize it. Grab one of the corners and hold down Shift on your keyboard. This will keep the image constrained perfectly so it's impossible to make it look squished or deformed.

You should now have something that looks a bit like this.

At this point you can make any changes to your spray to fill up the white space. I decided to add my name to the bottom of it, so it doesn't look like a hand is coming out of no where. I created this on a separate layer from everything else. I also adjusted the brightness and contrast of the Sandwich so it reads better in the game.

When I was done making any changes I merged the layers together to make the next steps easier. You can do this by shift clicking on all of your layers and right clicking and choosing Merge Layers within the Layers panel.

You should end up with something looking like this. Your spray should be on it's own single layer and you should have a background layer with nothing in it.

Defining the Transparent Spaces
Source games do not read PNG or GIF image transparency, It has to be done through Alpha Channels.

With your spray open, hold down control and click on the spray in the layer panel, I've highlighted the areas you need to click below, and what it should look like after you've clicked on it.

Next you want to click on the Channels tab, by default this will be next to Layers. If you somehow closed it you can reopen it by going to Windows > Channels.

With the Channels tab open and your foreground image selected, we will need to click on the Create New Channel button at the bottom. I've highlighted this selection below.

You will now notice that your image has gone entirely black. this is normal and just means you're doing everything correctly. When you apply alpha channels different colours mean different things.

  • White - Entirely Visible
  • Black - Invisible, these areas will not show
  • Gray - Semi-Transparent

For this tutorial I will simply be using White. Using some grey where you have drops shadows is typically a good idea, but isn't entirely necessary.

Select the paint bucket tool and choose a pure white colour, the HEX number you will be using is #FFFFF.

Paint in the selected area. You will now end up with a white blob kind of like what I have below.

Make all of your channels visible again. This is exactly the same as hiding a layer, simply click on the eye left to the left. All of them need to be set to visible, including the one you just created.

The red area is now the transparent part. If you are unhappy with how it came out you can readjust the Alpha Channels by going back or loading a previous save.

Mine isn't perfect by any means.

All that is left to do now is Save the image. Navigate to File > Save As... and save it as a Targa File (.TGA). You will need to make sure you have the Enable Alpha Channels option selected.

Creating the VTF with VTFEdit
We're almost there, and all that is left to do now is convert the TGA image in VTFEdit to a VTF. If you don't have VTFEdit yet, you can download it for free here[]. For those wondering, VTF stands for Valve Texture File.

Open up VTFEdit and select File > Import and navigate to your spray.

You will get a VTF Options panel popup. From a fresh install the only thing you need to change is the clamp, and it needs to be set to 256 by 256. I've posted a screenshot of the settings I used below.

You will need to change a few options once you have the spray imported. First of all you will notice that the spray is now on a white background, which obviously isn't transparent. Go to View > Masks and you will notice that it now looks similar to a transparent image in Photoshop again.

You will also want to make sure you have No Mipmap and No Level Of Detail checked under Flags on the left hand side. This will make your sprays high quality in the game, no matter who is viewing them.

All you need to do now is File > Save As.

You will also want to do Tools > Create VMT. Simply choose the defaults when you get the options window for this, and select Create. VMT stands for Valve Material File.

Importing Into TF2
You have now finished creating your spray, and the only thing left to do is try it out. All you need to do is paste your VTF and VMT file in to your TF2 directory. For most people this is located here:

VTF: C:/Program Files/Steam/steamapps/common/team fortress 2/tf/materials/VGUI/logos
VMT: [/b]C:/Program Files/Steam/steamapps/common/team fortress 2/tf/materials/VGUI/logos/UI

If you are missing any of those folders, simply create them.

Once you have everything in the correct directory, load up TF2 and go to Options > Multiplayer. Underneath the Spraypaint Image tab you should now see your brand new spray.

If it's not on the drop down menu you will need to choose Import Spray and navigate to it within the Steam directory.

Apply your changes and join a server, you're done! Keep in mind that some servers disable sprays as part of their config.

Closing Notes
If you have any questions or comments regarding this guide please feel free to leave a comment below or get in touch with me on Steam or through my website[].

You can also check out all of my other Steam Guides here.
< >
basic pug May 3 @ 5:55am 
bro your tutorials just saved me
appreciate it :B1:
beanb0iz Apr 17 @ 6:13am 
I used many times to create a spray but the last time I did that it didn't work
Naturalist Nuke Apr 16 @ 9:59am 
People have successfully used both GIMP and . I've used both. Maybe read through the comments to find people explaining how they've done it. Photoshop isn't essential, you just gotta know how to use the alternatives.
pyper Apr 15 @ 1:23pm 
this idiot thinks that everyone will pay like 100 dollars to make a spray transparent and he doesn't realize that GIMP and don't work
pyper Apr 15 @ 1:10pm 
The work path doesn't appear when using GIMP
beanb0iz Dec 29, 2020 @ 5:58pm 
I am having a problem, I am trying to create a transparent spray, but despite clicking on mask, on vtfedit, the background is still black
Metal Gear Mann Oct 26, 2020 @ 2:18am 
nvm i just restarted tf2
Metal Gear Mann Oct 26, 2020 @ 2:17am 
it aint working. i try to import it but it goes back to my previous spray i have and nothing else. i have the files in the folders that they need to be in and still nothing
Rema Sep 13, 2020 @ 8:24am 
For everyone who didnt find the spray, you need to move both vmf and vtf files to logos folder and vmf to ui folder. You will see the spray name in your settings, but the picture will be black, but dont worry, it works in game.
Roadstar Aug 17, 2020 @ 10:39am 
Nice, very detailed. It worked. Thank you.