TF2 spray maker

or drop one here, or paste it

The preview shows the spray as it will look in the file, after resizing and compression.

Make a TF2 spray from any picture

Turn any picture into a TF2 spray right in your browser. Nothing to install and nothing gets uploaded: the image never leaves your computer. Pick a PNG, JPG, WebP, GIF or BMP, choose what to do if it isn't square, and download a .vtf file TF2 can import straight away. Transparent parts of a PNG stay transparent, so your spray can be any shape. Sprays are still images only, so an animated GIF uses its first frame.

How to make a TF2 spray

  1. Choose a picture at the top of this page, drop one on the preview, or paste one.
  2. Pick a shape and size. 512 × 512 works for most pictures. The preview shows what the file will actually look like after compression.
  3. Download the spray.
  4. In TF2, open Options, then the Multiplayer tab, click Import Spray… and choose the downloaded file.
  5. Join a server. As the game puts it: “Changes to your spraypaint image take effect when you join a server.”

Why use a spray converter

TF2 can import a picture on its own, but only within limits. Its error message spells them out: “Valid height and width values in pixels are 256, 128, 64, 32, 16, 8, 4, 2, and 1.” The function that writes the spray file in Valve's published source, ImgUtl_ConvertToVTFAndDumpVMT, accepts four file types: TGA, JPG, BMP and VTF. The game converts the first three. A VTF it leaves alone, as the code comment says: “if the file is already in the vtf format there's no need to convert it”. A converter does that step for you. It resizes the picture, picks the format and writes the VTF, so you get to choose the size and quality instead of the game.

TF2 spray size

A spray file can be 512 KB at most, or exactly 524,288 bytes: MAX_CUSTOM_FILE_SIZE in Valve's source, commented “Half a megabyte”. How many pixels fit depends on the format. BGRA8888 stores every pixel uncompressed at four bytes each. DXT1 and DXT5 are compressed: DXT1 is half a byte per pixel and (the way this maker writes it) has no transparency, while DXT5 is one byte per pixel and keeps transparency. The maker picks the format for you. Here's what you get:

Size in pixelsNo transparencyWith transparency
256 × 256BGRA8888, 262,352 bytesBGRA8888, 262,352 bytes
512 × 512DXT1, 131,280 bytesDXT5, 262,352 bytes
720 × 720DXT1, 259,408 bytesDXT5, 518,608 bytes
1020 × 1020DXT1, 520,408 bytesDoes not fit

The TF2 wiki lists 1020 × 1020 as the biggest spray without transparency and 724 × 724 as the biggest with it. This maker caps transparent sprays at 720 × 720, because its files include a small thumbnail, and that pushes a 724 × 724 file to 524,384 bytes, 96 over the 524,288. The wiki also says pictures that aren't square get stretched or squashed to fit, which is why the maker asks you for a shape first.

How to use sprays in TF2

Stand close to a wall or floor, look at it and press your spray key (T by default, according to the wiki). The key runs impulse 201, so bind f "impulse 201" in the console moves it to F. In Valve's server code that impulse is “paint decal”: the game checks 128 units in front of you and only sprays if it hits the map. After that you have to wait. The server setting decalfrequency controls the wait, and it starts at 10 seconds.

If your spray does not show

Sprays, HUDs and crosshairs

Your spray has nothing to do with your HUD and works with any of them. To change the rest of your screen, build a HUD in the TF2 HUD editor or grab one of the TF2 HUDs. For your crosshair there's the TF2 crosshair maker. To save a spray bind and cl_spraydisable 0 in an autoexec.cfg, add them as custom lines in the TF2 config maker.