View Full Version : Help with .tga file and alpha channel Nanls 08-31-2005, 11:10 PM I am trying to recreate an effect in a targa file, using an alpha channel to mask. I don't have access to the designer or Photoshop files to figure this out and I am stumped. Here are the steps I am taking. In my layer I make a selection then use the Channels tab and 'Load selection as channel'. I then select it and inverse and use the gradient tool. This accomplishes matching the alpha channel of the image I am trying to duplicate the effect in the targa file and the alpha channels look very similar, however, when I go back to the layers with the RGB and alpha channels all turned on, the images look different. In his there is a large section of red, where it is masked... I don't know how this happens when I don't see it in the alpha channel. I'm hoping somebody understands .tga files and what I need to do to get the same effects to use as a mask.
thanks in advance,
Nancy Kraellin 08-31-2005, 11:24 PM I am trying to recreate an effect in a targa file
hi nancy,
what's the effect you're trying to create? what's the end result you're looking for here? also, i'm having trouble following what you're doing here.
In my layer in what layer?
I make a selection a selection of what?
a targe file, or .tga, is a composite. it's made up of two or more images all placed within one image. programmers use targas in things like games and other applications. in games they are quite often used for animating sprites. all the various parts of say, a person, are put in the targa individually and then the various parts are called up as needed all from the one file. so, you might have a person's head and torso as one image, his left arm, right arm, legs in one position, legs in another and so on. it's basic advantage is speed. since you're always referencing the same file, you never have to change your path or load new reference images into ram. so, it saves time and memory.
Craig Nanls 08-31-2005, 11:50 PM In Photoshop, the layer that I am going to save as a targa file with an alpha channel mask.
Sorry for the weak explanation.The file is for a photographer who has a green screen camera and program. The background image is saved as a jpg file and the forward image which mostly is a title and screen credits (the credits are on a black background) is saved as a targa file. His subject is photographed and then the photographer loads all three images into his program which sandwiches the subject between the back .jpg and the front .tga file. The targa files needs and alpha channel for the mask that allows the subjuct to fade into the credits.
Make more sense I hope?
Nanyc screenfx 09-01-2005, 04:56 AM I don't really understand the question, but I can tell you that I use targa files in my job and they are not handled any differently than any other 24 bit file format.
So it might help in this conversation to eliminate the targa issue from the equation. I don't think the fact that it's a targa has anything to do with the problem. Nanls 09-01-2005, 11:01 AM I already thought about that, unfortunetly the software the photographer uses requires a taga file for the process. This is hard to explain, however if you look at the new file I sent, it is easier. The first .jpg file (far left) will be used by the software as the background file. The second image, (movie credits),saved as a tga. file, isused by the software as the front image. The third images (some randon actress) is used by the software as the middle image. The software merges these files together. The alpha channel, created in the taga file, is used to mask the actress, so she will fade behind the credits. Now if you compare the alpha mask done for this file and the second alpha mask, that I did for my file, they look relatively alike, however, when you look at the two files from layers view with all channels on, (rgb and alpha) so you can see the outcome of the mask, you can see the difference in the files. My question is this... where is the difference and what step is he taking to get the file this way? ARGGG... this is soooo frustrating...
Thanks again, any help is appreciated.
Nancy creeduk 09-01-2005, 11:52 AM what software is the photographer using? If you are trying to rectreate something in Photoshop then the fact it is a traga file does not matter just as screenfx stated. Maybe by knowing the software we might understand better what you are trying to achieve. Kraellin 09-01-2005, 12:40 PM hi nancy,
ok, first a correction on my part. i think i was thinking of .lbm files, not .tga's. totally different beast. so, my mistake.
second, if i remember correctly, targa files save the alpha channel as part of the file, which is probably why your photographer is using them.
the alpha channel is being used as a mask, or to apply a mask. and it looks like it's set up in your example as a part hide all mask and part show all, possibly with a gradient between the two to get the fading effect.
to understand what's going on you have to understand masks and alpha channels a bit. a mask, any mask is always in grayscale, meaning totally black to totally white in steps comprising 256 gradations. a mask when applied to a layer is like a transparency within that layer. this 'transparency' can be completely opaque (totally black) or completely transparent (totally white), or any step in grays inbetween. the blacker it is, the more opaque it is. the whiter it is, the more transparent it is. thus, a 'hide all' mask is completely black and a 'show all' mask is completely white.
this mask can be altered also. you can change any of the shades of gray to lighter or darker.
the alpha channel is just a fancy way of saying 'some dedicated space in memory that holds information for a specific purpose'. in your examples the purpose is to hold information about a mask. the alpha channel is NOT the mask. but the alpha channel can hold the information that can be used as the mask.
when you apply the alpha channel holding the mask data, it then becomes the mask. in your case you could either mask the 2nd image (the model) or the top image (the credits). depending on which one you masked, you'd use the information in the alpha channel to create either a show all or a hide all, primarily. i say primarily because it appears as if you are using a combination of a hide all and a show all with gradations of grays to get the gradual fading effect.
ok, i looked at your attachment again. it appears that the mask is being applied to the top layer, the one with the credits. it's primarily using a hide all mask. that means the mask is mostly black. remember, the mask isnt the image of the credits; it's just an overlay ON the credits image. this overlay when black HIDES the information on that layer. when it's white, it lets the information show through. and when it's some shade of gray it lets it partially show through depending on the shade of the gray. so, with the top part of the mask as black, it hides the information on the top part of the credits layer and lets the model show through. as it goes gray and lighter and lighter towards white, it allows more and more of the credits layer shine through thus masking more and more of the model layer. remember, the credits layer is on TOP of the model, so it has precedence in what you actually see as the final combined image.
let's simplify this a bit now. you have three images you're trying to combine into one. think of these three as pieces of paper stacked on top of each other. and let's say you have all the images in one photoshop file, so, you have 1 image on each layer of the file. now, think of the mask as an adjustable transparency ON THE SAME LAYER as your credits layer. you can adjust the overall opacity of the mask or any part of it separately. that means every pixel of the mask can be adjusted for opacity by simply making that pixel, into any one of 256 shades of black/gray/white. and, because that mask ONLY applies to that layer, the shade of the pixels on the mask will either hide to some degree or show to some degree, the image that is also on THAT layer. thus, with the credits layer, some parts of that image will show through to the overall combined effect and some will not and some will partially show through.
the same also applies if the model is being masked to allow the background to show through. so, you might have another mask on the model layer, but the same rules apply.
if you already know all of this, then i'm not really sure what the problem is. so, i hope this helps.
Craig Nanls 09-01-2005, 01:03 PM Yes, I do already know this, but thanks for the very good explanation. I guess what I am trying to figure out is that if I am using the apha channel to hold the mask information, and it looks similar to the original, that I am trying to use as a guide, than why, why, why, when you look at the two files, with all channels turned on, including the alpha chanel, do they look so different, or in other words, why do the representations of the mask lookd so different, when the alpha channels look so much alike!
Can you see the difference I am talking about?
Thanks again,
Nancy Racc Iria 09-01-2005, 06:47 PM I recreated your problem with a little experiment. I use .tga and alpha channels all the time.
I don't think there's anything wrong with your alpha channel. I think you are just confusing yourself by displaying the RGB and the alpha channel at the same time.
When you do that, that alpha channel(s) are displayed as semi-transparent red over the RGB image. This does NOT represent what the mask is going to do! It just shows you where there IS a mask in your image. What you are seeing is the semi-transparent red "overlay" being affected by the black box (which does have a sharp edge) in the image. What you need to look at is the alpha channel by itself. When you do, there is no sharp edged box, just a smooth gradient. When that .tga file is read by your software that sharp edged black box will fade out softly over the image beneath it just as the alpha channel indicates it will.
If you really want to see how the alpha channel is going to mask the image, then make a copy of the target layer and turn all other layers off (if any). In the channels palette, Control+click the alpha channel thumbnail to load the selection. Go back to the RGB image, highligt the copied layer while the selection is still active and click the ADD LAYER MASK BUTTON at the bottom of the layers palette. If you did this correctly, the alpha channel will be applied as a layer mask thus showing how it will affect the transparency of the image. If you have multiple layers, then copy them and put them in a layer Group/Set and apply the layer mask to that.
I hope this clears up your confusion.
--Racc Nanls 09-02-2005, 05:30 PM Yes, thanks. It helps to see how the mask held in the alpha channel will affect the layer... that helps a lot and much easier to re-create the effect... I'm still not sure why the files with the alpha channel turned on, look so different.... but I'll just chalk it up to another mystery of the universe lol Racc Iria 09-02-2005, 08:03 PM Well, if you make more than one alpha channel (not supported in .tga by the way) and turn them all on you'll see differest shades red as each one intersects the other.
Think of the red you see when you turn on the alpha channel as an "onion skin" or a red transparancy (like those used in overhead projectors) that gets overlaid on top of the image. You can still see the image below it. But, if you zoom in and look real closely the gradient should still be there.
It's a way to view the selection represented by the alpha channel overlaid on top your image as a guide, while still allowing you to work on your image. Like you, I mostly find it confusing, and so rarely use it.
--Racc | |