Changing a texture's palette Created 2 years ago2021-12-17 11:42:22 UTC by Hatsuseno Hatsuseno

Created 2 years ago2021-12-17 11:42:22 UTC by Hatsuseno Hatsuseno

Posted 2 years ago2021-12-17 11:42:22 UTC Post #346124
Hello everyone! While I'm certain that the question I'm going to ask will sound very elementary to most people in here, no matter how many Google searches I've done I still can't wrap my head around how to make a simple palette change for a texture so as to, for example, change the textures of a blue scout in TFC to a purple one or convert the textures of the HL1 truck to winter-themed, white ones. My image editing skills are next to non-existent, so I'm hoping that someone could point me to a simple method to achieve this. Thanks in advance!
Posted 2 years ago2021-12-17 15:21:33 UTC Post #346125
From my distant memory, did this many years ago:
  • Export the texture as jpg or your favourite format
  • open in some app like paint.net or Photoshop
  • switch from indexed colors to RGB -> Profit
Posted 2 years ago2021-12-17 19:19:55 UTC Post #346126
I am guessing you've already managed to export the texture as a BMP or PNG file and it's 8-bit (indexed). If you haven't and don't know what the latter means, I'll explain. But anyway, let's say you're using GIMP and you got your texture with its palette.

In GIMP, you'll go to Windows -> Dockable Dialogs -> Colormap.
You will see something like this:
User posted image
On the left side, you can clearly see the palette and its 256 colours. From then onward, changing the palette is quite simple. You can right-click on one of these colours and click "Edit Color".

There's just one problem: if you want to change multiple colours, like, all the blue ones into red, it's gonna be tedious because you'll have to modify every colour that looks like the one you wanna replace (there are multiple blues in my case, and multiple greens, kinda hard to put my finger on the line there). For that, you can use fresco's suggestion. Once you import the texture into your image editor, you switch the mode to RGB, which will get rid of the 256-colour palette and let you do whatever you want.

If you want to change colours that way, you can select an area, and go to Color -> Hue-Saturation, and play with the hue setting:
User posted image
There is no easy way TBH. It all depends on what exactly you wanna do, and some types of edits will be simpler than others. You gotta practice to get the results you need, maybe for a couple of months or something. There will be pain and frustration along the way, but it's worth it IMO.
Admer456 Admer456If it ain't broken, don't fox it!
Posted 2 years ago2021-12-18 17:47:24 UTC Post #346129
Thank you both for your answers. And thank you Admer for the detailed answer based on GIMP - that's precisely the application I'm using. While I had managed to obtain the color palette myself after having switched to indexed mode, I ended up stumbling over the fact that I had to manually modify every color in the palette, but playing with Hue-Saturation in RGB mode did the trick.
You gotta practice to get the results you need, maybe for a couple of months or something. There will be pain and frustration along the way, but it's worth it IMO.
Yep, customizing game assets and creating new ones is definitely no easy process...but it's definitely worth it, there's only so much one can do by reusing the standard assets all the time.
Posted 2 years ago2021-12-19 13:45:11 UTC Post #346130
All of the popular wad-making tools can convert true-color RGB images to the 8-bit indexed format that HL uses. So if you're using Wally or HL Texture Tools then there are only a few cases where you need to work with palettes directly (when adjusting water fog color/intensity and when making custom decals). The typical workflow is to make a true-color texture in Photoshop/Gimp/Krita/whatever, using all the modern image-editing tools that they provide, and then export it to a bmp/png file which can then be added to a wad file with a wad-making tool.

Personally I don't like working with palettes at all, and I don't like having to export files and then having to manually update a wad file, so a while ago I made a new tool called WadMaker. It lets you create (or update) a wad file from a directory full of images (or Photoshop/Krita/Gimp files) with just a single action. Here's a tutorial on how to get started: Making textures with WadMaker (it's a command-line tool so it's not as easy to get started with as Wally or HL Texture Tools). For Gimp file support you'll need to do a bit of configuration, see WadMaker: Converting Gimp files, or follow the instructions in the wadmaker.config file.
Posted 2 years ago2021-12-20 22:32:20 UTC Post #346136
Player models have special texture palette handling: http://www.the303.org/tutorials/gold_remap.htm
You must be logged in to post a response.