Forums have been upgraded to the latest PHPBB3 version. Forum style recovery is pending.

Making Your Own Spray

Photoshop requests, photograpy and code samples. Anything artistic belongs here.
User avatar
Divine Fate
•cC• Forum Mod
•cC• Forum Mod
Posts: 869
Joined: 11 Jan 2009, 05:20
Steam ID: STEAM_0:0:14581138
Twitter Username: Nequissime
Xbox Gamer Tag: xelderon

Making Your Own Spray

Unread post by Divine Fate »

I had this posted a while back in a reply to another thread. This is a guide to converting images to the right size and format in order to use them as a spray in either Team Fortress 2 or Left 4 Dead. It also takes into account that your images may not be perfectly square, so it will add transparency and scale down your images for importing images of all sizes.

1) First off, use photoshop or gimp. I use gimp for sprays because it's quick and easy and doesn't eat my processer up like candy on halloween.

2) Now, open your image in GIMP. The best way to convert images without stretching is to do the following:
  • At the top, select Image>Scale Image... and change the highest variable (width or height) and change it to 256. Make sure the lock is on so that the opposite variable will change with it. Click Scale. (If neither of your variables are above 256, skip this step)
  • Next do the same, except select Image>Canvas Size... and UNLOCK the lock setting mentioned in the previous step. Now change the variable that isn't 256 to 256 so that both are the same. Under offset, click the center button. Click Resize.
  • If done correctly (and transparency is set as default background, which usually is), you should have what you need to make a spray. Go to File>Save As... and save it as <ImageName.TGA>. Make sure it's a TGA file.
3) From here, you can either manually add the TGA files to your game, or convert them to VTF files yourself.
  • Download VTFEdit.
  • Run it, File>Import and select your TGA file.
  • Leave default settings, click OK, and File>Save As... and save your file (as a VTF). If you added transparency, the preview should look like it is surrounded by black.
And that's all there is to it, have fun ;).
Image
User avatar
z0th
•cC• Member
•cC• Member
Posts: 296
Joined: 30 Dec 2008, 09:29
Location: 99.225.243.0/24
Contact:

Re: Making Your Own Spray

Unread post by z0th »

MODS: can we make this a sticky thread?

I looked at one of the "how do i make a spray" threads this morning and noticed there was a Paint.NET build of Nem's VTF plugin. I figured I should be able to muddle my way through getting this figured out without too much problem. Here are the basic steps i took to make a couple of VTF sprays.

It is important to note that the VTF Plugin for Paint.NET is 32-bit ONLY and will not work on a 64-bit operating system unless you have some sort of compatibility mode available to you. Nem's site seems to go down on a fairly regular basis - unsure as to why (see the NOTES section below).

How To Make TF2 Sprays Using Paint.NET & Nem's VTF Plugin

What you will need: What you need to know:
  • spray images may be no more than 256x256 pixels
  • spray images may be no more than 120KB in size
  • VTF files are large, so a small JPEG file will end up being a much larger VTF file.
PART ONE: Software install
  1. Download paint.net and the VTF plugin.
  2. Install paint.net
  3. Extract the VTF filetype plugin .ZIP file to the "Filetypes" directory in your paint.net install (probably something like C:\Program Files\Paint.NET\Filetypes\).
Ok, now that you have paint.net and the VTF plugin installed, its time to make the actual spray itself. The ASSUMPTION here is that you already have a picture you want to use that is 256x256 (or smaller).

PART TWO: Generate the VTF
  1. Open up paint.net.
  2. Click on File -> New, this will open up a "New" dialog.
  3. In the "New" dialog, set the width and height to 256 px. If the "maintain aspect ratio" is checked, uncheck it. Hit OK. This should make your overall canvas size much smaller.
  4. Click on Layers -> Import From File and browse to the file you want to use as a spray.
  5. Click on File -> Save As, name the file browse to your save location. then go to the "Save As Type" box middle bottom and switch the file type to .VTF and hit "Save".
  6. Copy your VTF file to your Steam install. This will probably be something like C:\Program Files\Steam\steamapps\<STEAM_ACCOUNT_NAME>\team fortress 2\tf\materials\VGUI\logos\. If the "logos" directory doesnt exist, create it.
  7. Import the spray in-game under Options -> Multiplayer -> Import Spray.
NOTES:
  • If the option to save as VTF is missing, then the VTF plugin is not installed properly.
  • The only good way to determine how large the VTF file will be is to watch the size in the Save As dialog. Paint.NET can predict file sizes. so if the VTF is more than 120KB it will not work as a spray. my experience has been that if you size your pics to 128x128px, you should be well under the 120KB limit.
  • VTF files should ideally be square -- so edit your pic to 256x256 to work with first.
  • VTF files can only be saved in pixel widths that are powers of two (i.e. 256px,128px,64px,32px)
[*] Just in case Nem's site is down, the v1.04 of the plugin is attached below.
pdnvtfplugin104.zip
Nem's Paint.NET VTF Plugin v1.04
(254.44 KiB) Downloaded 276 times
User avatar
Sumofl
Posts: 12
Joined: 22 Aug 2009, 08:12
Steam ID: STEAM_0:0:21093009
Xbox Gamer Tag: Sumofl

Re: Making Your Own Spray

Unread post by Sumofl »

I just open Photoshop and save as a targa file and then import as that.
Image
User avatar
MrKerplunkers
•cC• Forum Mod
•cC• Forum Mod
Posts: 1904
Joined: 05 Dec 2008, 05:58
Steam ID: STEAM_0:0:18601661
Location: Between the Devil and the deep blue sea

Re: Making Your Own Spray

Unread post by MrKerplunkers »

Taken from GameBanana


CREATE A SPRAY FROM A GIF FILE

To begin...

You will need Gif editing software. I use ULEAD gif animator so therefore my tutorial will be based around it mainly. You will also need VTFEdit.

1) Open up gif animator. File>new

Set the X and Y to something that's the power of 2. 32, 64, 128, 256. The smaller it is the more frames you will be able to have but you have to make sure your gif fits within the boundaries. Import your gif by dragging it in.

2) File>Save as>Image frames

Change the save type to .png and quality 100. Call it "image" (without the speech marks). Then save it in its own folder
You are done with ULEAD, now you need to open up VTFEdit.

3) File>Import
Highlight all of the .pngs you have made and click "open".
Set texture type to "animated texture".
Click OK. Click play to see if it worked.
Then click "info" and check how big the spray is. Anything over 125kb is too much and wont work - if this is the case you must go back to the gif editor and delete some frames or make the gif dimensions smaller.

4) If it worked and you're happy with it. Click Options and make sure "Auto create VMT file is checked".
Save your spray into C:\Program Files\Steam\steamapps(Your username)\team fortress 2\tf\materials\VGUI\logos
and try it out in game!
Image
Post Reply