Looking for Spraymaker? You probably want Spraymaker version 2 instead!

Spraymaker5000

Spraymaker5000 is a GUI tool to create custom high quality sprays for Source engine games. Version 1 is written in C# .NET and uses WPF for the GUI. Version 2 is written in C++ and uses the Qt framework for the GUI. I recommend using Spraymaker version 2 unless you have a specific reason to prefer this version.

The tool makes calls to external binaries (FFMpeg and crunch) to import, transform, and convert the image data. These images are then stitched together into the VTF format. It’s all rather crude, but it was only intended to be a prototype!

Because I was embarrassed by how bad the code was, I never published it. Instead, I did a complete rewrite of the program and published its code under the GNU GPLv3.0. I can’t say my C++ version wouldn’t make a more competent programmer cry in horror, but at least it’s an improvement.

Inspiration

I was an avid user of sprays and even got into the habit of making a brand new spray between every mapchange while playing. Unfortunately, the process of doing so was quite tedious and manual:

  • Open image in GIMP and…
    • (Auto)crop
    • Rotate
    • Scale to 512x512 pixels
    • Export
  • Open exported image in VTFEdit and…
    • Manually configure image format (DXT1A, DXT5, mipmap settings, etc.)
    • Save to VTF
  • Go back to the game and import the created VTF file

Technically the first part is optional, but most of the time you’d want to do it for optimal results. VTFEdit can scale input images, but it won’t maintain the aspect ratio. It’s also limited by the ATI (AMD) backend it uses for DXTn texture handling which requires resolutions to be a power of 2; but this limit isn’t intrinsic to the format. You could oversize the texture and crop the unnecessary data off to support arbitrary resolutions… but it’d make more sense to update the library to something more modern and less restrictive.

If you wanted to do something fancy like animation you’d have to manually split the input image into frames and import all of those into VTFEdit. Want to make a fading spray by using custom mipmaps? Well that’ll mean using some archaic old software to crudge the images together and then spudge them apart again. Quite slow and tedious, and trying to do animation and custom mipmaps at the same time is out of the question.

Enter: the Spraymaker5000! I wrote this tool to streamline the above process into a handy click-and-drag GUI so I’d never have to open an image editor or manually convert file formats ever again. And it can install the sprays directly into the games, so I didn’t have to import them manually anymore, either.

In the process of writing Spraymaker I discovered that sprays weren’t limited to resolutions of a power of 2 (ex. with 512x512 pixels being the max) and could actually be (with some restrictions based on image format) nearly any resolution! The reason nobody did 1024x1024 pixel sprays was because this put the filesize just barely over the 512 KiB limit, and VTFEdit doesn’t support resolutions which aren’t a power of 2. If, however, you made a 1024x1020 pixel spray, you’d just eek under the 512 KiB filesize limit.

Thus: the Spraymaker can make higher resolution sprays which are animated, fading (mipmapped), or both at the same time. It can autocrop input images, scale them with the highest quality possible, and supports several output image data formats for the best possible quality given the desired spray type.

Download

Nagging again: You probably want to use Spraymaker version 2 unless you have a specific need for this older version. Let me know if this is you so I can improve version 2!

These binaries are for Windows but still mostly work on Linux using Wine.

Download Spraymaker5000 version 1.3.0.23, 1.3.0.21, 1.2.0.20, 1.1.0.18, 1.0.0.17.