Convert Any Image into a Game Spray
Valve recently hosted a TF2 propaganda contest for the War between the Soldier & Demoman classes. Every one of these posters are perfect to make a game spray out of. This tutorial is specifically for converting any ordinary image into a high quality game spray with transparency. I'm using Photoshop CS3 and my propaganda entry for the tutorial. However, GIMP will work just as well but the menus / commands will not be exactly the same.
Here's the image of my propaganda entry which I'll use as an example throughout this tutorial:

To a in-game spray: ( click for fullsize)
Step 1: Sprays are Square
Spray supported games expect sprays to be perfectly square. 256x256 is the largest allowed and therefore the optimal dimension. My poster is not square AND it's larger than 256 pixels in both dimensions. No problem, first I'll open the "Canvas Size" window.
Image > Canvas Size...

Since my poster is taller than it is wide, I take the Height dimension, 580, and copy it into the Width dimension. If your poster is wider than tall, put the width into the height.

After clicking OK, my poster is surrounded by gray effectively making it a perfect square.

However, the dimensions are too large. Resize it to 256x256.
Image > Image Size...

Here's my resized propaganda poster.

Step 2: Defining the Transparent Areas
Unless your image content is perfectly square, you should define areas of transparency . It will help to make your final spray look like part of the game. In this case, my poster is taller than it is wide.
If your image is on it's own layer, simply Ctrl + Click the layer to select it's shape.
If your image isn't on it's own layer, use the magic wand tool and Ctrl + Click the areas you want transparent followed by inversing your selection, Select > Inverse, so your image content is selected.

Now click the Channels Tab and click New Channel.

Keep in mind:
- White = Visible
- Black = Fully Transparent
- Shades of Gray = Partial Transparency
We want the poster to be 100% visible, so fill the selection with White using the Paint Bucket Tool. Everything outside of the poster should be black a.k.a. fully transparent.

Make all the channels visible again by toggling the visible option for each. Switch back to the Layers tab. Everything in red will be transparent in the game.

Now you're ready to convert your properly formatted image into the final spray file, .VTF.
If you're using Photoshop goto Step 3a. If you're not using Photoshop, goto Step 3b.
Step 3a: Saving as .VTF directly from Photoshop
Since you're using Photoshop, you can download a plugin that will allow you to save .VTF sprays. Download the Photoshop VTF plugin, follow the instructions to install.
Now save as, .VTF and simply choose "Spray with Transpancy" from the templates.

You're done, skip to Step 4.
Step 3b: Save as .TGA with Alpha Channels
Save your image as a Targa file (.TGA)
File > Save As...
If you defined transparency areas, make sure the "Alpha Channels" option is selected, then save your .TGA file.

Now we'll use VTFEdit to convert your .TGA into a .VTF
Download VTFEdit and install. Open the program and import your .tga file.
File > Import
I use the following settings for importing a .tga file.

You should see your spray in VTFEdit now, the transparent areas will be the color you used for the background.
Important! Under the Flags list, check off "no mipmap" and "no level of detail". This will allow your sprays to appear in max quality even when running the game on low settings.
Now save your spray as a .vtf.
File > Save As...
1. Browse to C:/Program Files/Steam/steamapps//team fortress 2/tf/materials/VGUI/logos/
Note: is whatever your steam login is.
If you can't find the folders 'VGUI' or 'logos' in the 'materials' folder, simply create them. Make sure the 'logos' folder is inside the 'VGUI' folder.
2. Put the .vtf and .vmt files for the spray into the folder. You're done.
Step 5: Using the spray in the game
1. Launch Team Fortress 2.
2. Click Options > Multiplayer and select the desired spray from the drop down list.
Note: If you don't see the spray in the drop down then double check that the spray file is in the correct folder.
3. Join a server, walk up to a wall and press 't'. POW! You just tagged the wall.
Conclusion
If you have any questions feel free to contact me via the contact form. Otherwise, I hope to see your poster in game and on gamesprays.com for others to spray. You can submit them via the spray submission form.
Here's a screen shot of the final spray in game. You can download it here: TF2 Propaganda Poster
Click to see full size.









