Jump to content
Sign in to follow this  
hcpookie

HOW-TO: Apply a transparency mask to a texture with GIMP

Recommended Posts

I am sharing this to help others who need to apply transparencies to textures. I figured this out while working on my camo net mod and made sure to document the steps :) I talk about camo patterns, but the principle applies to any texture where a transparency is required (such as a window, optic, or viewport texture). Please understand I am not a graphic designer so there may be easier ways to do this, but this worked for me.

Both the original texture and the template need to be saved in a format acceptable for use - 1024x1024, 512x512, etc. TexView2 will not be able to open or convert graphics that aren't in the proper sizes.

You will also need a 2-color template to use for your transparency. The camo nets have a very detailed transparency design that will require a great deal of work. If you are creating something like a window, your template would be a large square with four smaller squares to represent the panes of glass. These smaller squares would become the transparent layer. The colors you choose should be completely different from your original color scheme. If the template colors are close enough to the original colors, it can "bleed through" and cause problems with the transparency. Therefore Black/White should probably not be used. Use some "clown color" scheme like Red/Blue, etc. for the template that is completely different from the graphic's colors.

Also be sure that the GIMP background is a neutral color (found under Edit > Preferences). I like to use a white background so when you select on camo colors it is easy to identify the mask, and you don't have accidental "bleed through" of the template. Of course, a white background with a snow camo pattern is not a good thing! I altered the background to be dark grey for the snow camo edits :)

If you are dealing with a camo pattern, you should tweak the surface effects to give it some depth with filters. When viewed up-close this will make a better texture. Good filters to apply for breaking up and darkening the image:

  • Filters > Artistic:
  • Clothify (play around with the settings)
  • Apply Canvas (setting of "2" is what I usually use)
  • Cubism (gives the texture a slightly "digital camo" look)

These are the ones I've used mostly. There are many other filters to choose from, however. Don't like a change? Use CTRL+Z to undo it and try again with different settings.

When you are satisfied with the texture, apply the transparency to the texture. NOTE: you should save a copy of your original texture as a reference that you can go back to!

1. Start with the transparency template:

  • Open the template graphic in GIMP.
  • Select by color: (Select > "By Color")
  • Click to select on the transparent area. Blinking dotted lines will outline the selection.
  • Add layer mask (Layer > Mask > Add Layer Mask):
  • "Grayscale Copy"
  • Check "Invert Mask"
  • Click Add to add the mask. The blinking dotted lines will refresh.
  • Use CTRL+C to copy the mask (or select Edit > Copy).

2. Open the target graphic (again, you should make a BACKUP of your original before proceeding!)

  • Once open, type CTRL+V (or Edit > Paste) to apply mask. The template will appear with blinking dotted lines around it.
  • De-select all to remove focus from mask. Do this by choosing "Select > All", then "Select > None". (in other words click off of the graphic to remove the blinking dashes).
  • Select by color (Select > By Color):
  • Click to select the transparent area. The blinking dotted lines will refresh. (This is the part where it matters what the template color is - if you find part of your original texture is being selected because the template is allowing "bleed through" then you need to start over with a new template and/or GIMP background color).
  • Invert the selection by choosing "Select > Invert". The blinking lines will again refresh.
  • Add a layer mask (Layer > Mask > Add Layer Mask):
  • "Selection"
  • Un-Check "Invert Mask" (it is probably checked from the last action)
  • Apply layer mask (Layer > Mask > "Apply Layer Mask").

3. Convert texture to proper format. Use "Select > None" to better view the final graphic.

  • Save As… TGA:
  • IMPORTANT: Un-Check "RLE Compression" (no not compress!)
  • Open TexView2.
  • Click and drag the graphic onto the TexView2 work area. Note: sometimes the TexView's File > Open menu doesn't always work well, so clicking and dragging the graphic is recommended.
  • File > Save As will automatically select "texturename.tga.paa". Simply edit this so the ".tga" part is removed. Now you have a .PAA file of your graphic that is ready to be used!

Like I said previously, I'm not a graphic artist so there may be better ways to do all of this. Hopefully this will help save someone from having to stumble through GIMP trying to discover it for themselves :)

Edited by Max Power

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×