04-29-2009, 06:04 PM
I've CTFified a few maps and when doing it, you usually want to have the trims and textures have hints of blue or red to tell the player which side of the map they are on. I don't feel like editing a bunch of images by hand, so I don't.
I use the amazing command line tool called "image magick" (apt-get install imagemagick). Usually it's a simple -modulate with some RGB color levels. This only works with trim that has a base color of a gray hue, otherwise, you're modulating the entire wall and breaking the flow in the textures (i.e. you can turn green to purple or something).
Here's an example of the simple modulation command where I turned the yellow image to a red one:
![[Image: owzytu1rhyfemap6c4g.png]](http://pics.nexuizninjaz.com/images/owzytu1rhyfemap6c4g.png)
For those of you familiar with the Egyptian texture pack, you probably noticed there are some missing red textures. Well today, I gave batch converting a shot and here's what I discovered...
Making mask from a single source file on a complex image is hard, sloppy and doesn't come out too well (red exaggerated for effect, you can see how it leaks into the stone).
1. I extract the blue channel
2. I adjust the levels to exaggerate the dark and light spots
3. I colorize the mask
4. I layer it on top of the old texture and output it
![[Image: pgtaa42ip3yju9jxwjv9.png]](http://pics.nexuizninjaz.com/images/pgtaa42ip3yju9jxwjv9.png)
Here's the most accurate code for this method I found, though you'll likely have to play with the values to get it right for your textures.
Fortunately for me, this texture pack has a lot of neutral textures of the same style. So rather than try bust my ass failing with the previous method (which can actually work out pretty well for less complex textures mind you), I created a mask based on the difference between the images.
1. I create a mask based on the difference of the images
2. I colorize the mask
3. I overlay it and flatten the image
![[Image: hw6axas88th57ieffi2n.png]](http://pics.nexuizninjaz.com/images/hw6axas88th57ieffi2n.png)
And for this image technique:
I experiment a little with matching it to the red version of this texture I was working with and here's the values I came up with:
With some clever bash scripting, I can loop this and batch create complementary images for the texture pack \m/(-.-)\m/
Hope this helped explain some things to people / inspire them :).
Image Magick Resources:
Usage with examples
Command line options
If you ask me why I didn't use <image editing software>, I will ignore your post.
I use the amazing command line tool called "image magick" (apt-get install imagemagick). Usually it's a simple -modulate with some RGB color levels. This only works with trim that has a base color of a gray hue, otherwise, you're modulating the entire wall and breaking the flow in the textures (i.e. you can turn green to purple or something).
Here's an example of the simple modulation command where I turned the yellow image to a red one:
![[Image: owzytu1rhyfemap6c4g.png]](http://pics.nexuizninjaz.com/images/owzytu1rhyfemap6c4g.png)
For those of you familiar with the Egyptian texture pack, you probably noticed there are some missing red textures. Well today, I gave batch converting a shot and here's what I discovered...
Making mask from a single source file on a complex image is hard, sloppy and doesn't come out too well (red exaggerated for effect, you can see how it leaks into the stone).
1. I extract the blue channel
2. I adjust the levels to exaggerate the dark and light spots
3. I colorize the mask
4. I layer it on top of the old texture and output it
![[Image: pgtaa42ip3yju9jxwjv9.png]](http://pics.nexuizninjaz.com/images/pgtaa42ip3yju9jxwjv9.png)
Here's the most accurate code for this method I found, though you'll likely have to play with the values to get it right for your textures.
Code:
convert s064-02d.tga -channel B -separate separated_b.tga
convert separated_b.tga -level 8%,45%,0.4 b_leveled.tga
convert b_leveled.tga -background "#972F2F" -alpha Shape b_mask.tga
convert s064-02d.tga -page +0+0 b_mask.tga -flatten new_texture.tgaFortunately for me, this texture pack has a lot of neutral textures of the same style. So rather than try bust my ass failing with the previous method (which can actually work out pretty well for less complex textures mind you), I created a mask based on the difference between the images.
1. I create a mask based on the difference of the images
2. I colorize the mask
3. I overlay it and flatten the image
![[Image: hw6axas88th57ieffi2n.png]](http://pics.nexuizninjaz.com/images/hw6axas88th57ieffi2n.png)
And for this image technique:
Code:
convert s064-02d.tga s064-02b.tga -compose ChangeMask -composite b_mask.tga
convert b_mask.tga -fx G -fill "#C62D2D" -tint 100 r_mask.tga
convert s064-02d.tga -page +0+0 r_mask.tga -flatten new_texture.tgaI experiment a little with matching it to the red version of this texture I was working with and here's the values I came up with:
Code:
-fx G -fill "#740E00" -tint 70With some clever bash scripting, I can loop this and batch create complementary images for the texture pack \m/(-.-)\m/
Hope this helped explain some things to people / inspire them :).
Image Magick Resources:
Usage with examples
Command line options
If you ask me why I didn't use <image editing software>, I will ignore your post.