TF2 Custom Spray Image with Transparency
Thursday, October 11th, 2007 at 2236I’ve been playing Team Fortress 2 a little lately, and it’s most entertaining. As some of you may know, it being a Valve game, the option to “spraypaint” a tag onto the walls is present as it was in Counterstrike, however, creating these custom images for use can be a bit of a pain.
First of all, you’ll need something like Photoshop. GIMP will do, but these instructions are for Photoshop.
Next you’ll need VTF Edit, which you can get from the bottom of the VTF Edit website. It’s a lot cheaper than Photoshop…
- Now open Photoshop. Create a blank 256×256 RGB 8-bit image.
- Fill this image with mid-grey R 128, G 128, B 128.
- Create a new layer on top of this, and draw / add whatever you want to it. Delete from this layer any bits you want to be transparent in the final spray image
- Press CTRL and click the layer you’re drawing on in the layers pallete, this selects only what you’ve drawn onto the layer
- On the Channels tab, click the second button from the left to “Create alpha channel from selection”
- Go back to the layers tab. Click Layer->Flatten Image
- Now save the image as a TGA file, make sure Alpha Channels is ticked, hit OK and select “32 bit” if a little dialog pops up
- Open VTF Edit, go to File->Import and select your TGA file
- In the dialog that appears, uncheck “Generate Mipmaps” and leave everything else default. Alpha Format should read ‘DXT5′. Hit OK.
- To confirm that yout TGA alpha map worked OK, you can check View->Mask, which should turn on the alpha map preview
- Go to File->Save As and save the file
Once you’ve generated the VTF file you need to place it in two locations:
- \Steam\steamapps\
\team fortress 2\tf\materials\VGUI\logos\ - \Steam\steamapps\
\team fortress 2\tf\materials\VGUI\logos\UI\
If the folders don’t exist, then just create them. As far as I can tell, it is case sensitive, so watch out for that. When you’re all done with that, load TF2 and go to the Advanced tab on the options page and select your spray tag image.
Simple… 😉
Update:
Blagpuss points out that some users might need to add “_english” to the ‘tf’ portion of the path, this might vary for users with other regionalised copies too, so watch out for that.
My contribution (Day of Defeat source) http://www.flickr.com/photos/adonaldson/331883522/
And mine: http://s80.photobucket.com/albums/j166/denyerec/?action=view¤t=cp_gravelpit0000.jpg
Watch people do not steal your Monkey icon!!! Oh, and is there VTF for Linux?
GIMP, GIMP, GIMP, GIMP, GIMP, GIMP, GIMP, GIMP, ………
Thank you for the help! I had Photoshop had VTFEdit, but just wasn’t having any luck until I stumbled onto your site. Worked perfectly.
Does this work for the animated sprays as well?
I’ll have to try tomorrow when i’m less burnt out…Thanks for the tips.
Everything you’ve said above is correct but the path isn’t
the correct path is
C:\Program Files\Steam\SteamApps\Account name\team fortress 2\tf_english\materials\VGUI\logos
C:\Program Files\Steam\Steam\Apps\Account name\team fortress 2\tf_english\materials\VGUI\logos\UI
Perhaps on internationalised copies of TF2, but on the default english version the path is as stated.
Does this apply to Photoshop CS3? Because I can’t find the “Create alpha channel from selection” in channels tab.
Yes, the instructions are for CS3. If you do a google search for “Create alpha channel from selection” you should find a few tutorials that show you with screenshots what’s going on.
Thx for the aid!
Loved this. Learned how to make transparent spray!
A great Tutorial many thanks, works fine for me after adding “_english”.
@ Mark: I think CS3 says “Save selection as channel” or something along those lines. It’s in the same spot, 2nd from the left on channels palette.
I run with PS 7.0, and it insists that TGA files must be saved as copies, which also denies me the ability to preserve the Alpha Channel. As a result, the gray areas of my image are still there when I try to use it as a spray. I tried saving as a PNG to circumvent this (it’s still recognized by VTFEdit and it allows Alpha Channels), but it didn’t work. I suppose I can just come up with some crap to fill it with, but I’d rather not.
Thanks for the guide, though. It’s quite helpful.
i have Adobe Photoshop Elements. i can almost do my spray but one problem is that
i cant find the Channels tab to turn on “Create alpha channel from selection.” can anyone help me or guide me to it X mark the spot please?
@Mark,
In the Channels tab, when you mouse over the buttons, none of them say anything about Alpha. Just do what the tut says and click the second from the left, it will work.
Thanks for the tut! Has worked a treat.
@Voyager: tga support on photoshop 7 is a bit buggy, and has been patched. see here:
http://nicolaescher.com/journal/article/20/photoshop-7-tga-plug-in-alpha-channel-bug
and, ultimately, here:
http://www.adobe.com/support/downloads/detail.jsp?ftpID=1544
this got targa transparency working for me in PS7
[…] Re: Help make a meat mountain spray I don’t have the time right now, but here’s a tutorial on how to do it: Make a custom spray with transparency. […]
when you say name do you mean your account name or your game name.
“name” is in place of your account name.
Is there an alpha channel in gimp? If so where?
I’m having the same problem that Jawa is. I have Adobe Photoshop Elements 7, and I can’t find any “Channels tab” anywhere. I read help and saw that “Photoshop elements doesn’t have a channels pallete”. Is there anything I can do?
I don’t think you can access the Channels directly in Elements, though I’ve never used it so am not sure. It SHOULD support transparency, perhaps just in a different way to Photoshop.
As for the GIMP I’m afraid I have no idea. I’ve never been comfortable with that software, perhaps someone else in the comments here might lend a hand?
Could you put up the instructions or
tell us where we could get the instructions to make a trasparent spray using the free program gimp please?
And this cant be done with photoshop elements 2.0 can it?
[…] "TF2 Custom Spray Image with Transparency" @ […]
what do I do if I don’t have the VGUI folder?
Just create any folders you don’t have to match the required directory structure.
When i try to create the files it says I can’t use a forward slash, help?
Create them one at a time, so if you don’t have: tf_english\materials\VGUI\logos you’d go into \tf_english\ and create “material”, then go into the folder you just created called “materials” and create “VGUI” etc… Hope that helps!