» Fri May 04, 2012 2:17 pm
Since I have an hour to kill I am going to post a detailed methodology of how I would make an icon as a targa. If it helps anyone understand it was worth it, if not, oh well. This will assume you have: paint (installed automatically on any windows machine), gimp (free powerful image editor), and dxtbmp (free, see above post) - optionally irfanview (free).
- Locate an existing .tga icon in Data Files/Icons/... Open with dxtbmp. Go to menu "Image" and select "Send to Editor". The image without alpha has now been opened in a paint window for you called "norm.bmp". Now you can either draw your new icon image in paint, or draw it elsewhere or use one you made/edited previously and just paste it into this paint window - dont worry about the alpha stuff for this part, just make sure it looks how you want it to look overall as a 32x32 image itself. Now save it (important - do not "save as" as that will change the directory and dxtbmp wont be able to reload it) - just "save" - don't close this window yet as you need it for later steps. Now back to dxtbmp window and "Image -> Reload after Edit".
- (Optional) If you find your image used in the above step needs color/brightness corrections, paste it into irfanview and then pick "Color Corrections" or "Enhance Colors" depending on what version you have. Irfanview provides a one-stop shop for changing RGB, gamma correction, brightness/contrast, etc as opposed to gimp's which has your color tools spread out into different dialogs. I know gimp's is more powerful, but I find not being able to do all my (simple) color edits under a single preview session a bit irritating at times. When done, copy and then paste it back into your "norm.bmp" paint window, save, and reload after edit in dxtbmp as described above.
- Now for your alpha. Start up gimp, and paste your image from "norm.bmp" into gimp. Now from your gimp layers box, create a duplicate layer, and select it. Click the eye icon to make it not visible for now. Now select the visible layer (the one that still has an eye icon). Now, in the gimp image window (where the image is displayed), fill it with all black. Next go back to gimp layers box and click the eye icon so that both layers are visible (both show an eye icon). Now click the topmost layer (should be the all black one but it doesnt matter what order they are in really). Adjust the visibility slider for the topmost layer to about 60-70% so that you can "see through" the black layer a little. This black layer is your alpha layer and will be referred to as such henceforth. Now, using the pencil tool in gimp, set it to 1 pixel dimension and make sure white is the selected color (look for the intersecting black and white boxes at the lower part of the gimp toolbox window, and click the tiny arrows thing until white is the top box). Make sure the alpha (black) layer is selected in the gimp layers box. Now, in the gimp image window you can start clicking around the edge of your "real" image which you should be able to see partially through the alpha layer. In other words you are tracing the edge of your "real image" pixel-by-pixel with the white pencil tool. (zoom in your view as needed). When completely traced, now fill in the inside pixels with white as well. When you are done, the parts of your "real" image that you want to be visible should look "lit-up". Now you need to get this alpha image you just drew into dxtbmp. The "refresh alpha" feature in dxtbmp sometimes creates errors in the alpha layer so dont use it. Instead, use a workboard bmp. I personally use a file named "1alphaworkboard" so it's at the top of the textures directory and thus easy to scroll to. In other words, from gimp, copy your alpha layer, paste it into paint (make sure it stays 32x32), and save as a new file name. Now in dxtbmp use "Import alpha channel" and select the file you just saved as. Now you have both your "real" image and your alpha image loaded into dxtbmp. Save from dxtbmp as the file name you want for this new icon. And that's it, before closing any windows - view the finished tga you just saved and make sure it looks as expected (see below)
- (optional) Open your new tga file with irfanview, which shows you how the finished product will look with all alpha transparency applied. Much faster than loading photoshop or gimp.