PDA

View Full Version : Photoshop transparency/alpha channels


willman256
2005.10.27, 09:16 AM
hi, sorry for an off topic post, you can delete this topic when i get an answer!

Basically i have a jpg image of a muzzle flash with a black backgorund, i want to save it is a PNG so dim3 will support this image but how do i set it so that when i save it as a PNG the black will be transparent, otherwise known as a PNG with transparecny, ive seen his before with explosions and the smoke on dim3 so how do i do that in PHOTOSHOP????? :D

Taxxodium
2005.10.27, 09:38 AM
You don't do it in Photoshop. In SDL for example you can set an aplha color, in this case, setting it to black will result in a transparent picture.

If you wanna do this in Photoshop, you'll need to make sure the image has an alpha channel. You can make an alpha channel in Photoshop yourself, but depending on the image this may be a lengthy process.

socksy
2005.10.27, 09:45 AM
He's talking about Dim3, SDL 2D graphics are, I think, out of the question here. ;)

Why didn't you create an image with an alpha channel in the first place? Then add the picture on top?

Anyway, add an alpha channel and delete the black, I believe you add the alpha channel to the layer but I can't be sure.

Taxxodium
2005.10.27, 09:52 AM
He's talking about Dim3, SDL 2D graphics are, I think, out of the question here. ;)

I said, for example :)

willman256
2005.10.27, 10:52 AM
how do you an add an alpha channel in photoshop? and which channel do i delete the black on?

teh1ghool
2005.10.27, 11:28 AM
Is photoshop use the magic wand tool and select all of the black background. Delete it. Save. Use the new flash with a little big of transparency in the game. Voila!!!

willman256
2005.10.27, 11:57 AM
ok, good idea ill use that, ill post what ive managed to do soon! and dont you mean opacity?

jamie
2005.10.27, 01:08 PM
A tutorial for creating alpha channels in photoshop was recently posted here:

http://unify.bluegillweb.com/

willman256
2005.10.27, 01:16 PM
thanks for the tutorial, thats a great help, thanks alot!

willman256
2005.10.27, 04:27 PM
here what i managed to get using teh1ghools suggestions
http://i20.photobucket.com/albums/b241/willman256/m16flash.png

teh1ghool
2005.10.27, 08:00 PM
You're only spose to adjust the transparency of the actual flare inside the engine. Keep it 1.0 alpha in the png. And I'd start with layers and a transparent doc in photoshop so you don't have those nasty black areas on yours.

aarku
2005.10.28, 02:59 AM
A quick move to the correct forum for this question (Designer's Studio) and a simple rename to a more descriptive thread title, and "Tada!" No more off-topic and everyone is happy. Perhaps this can be done in the future! ;)

What version of Photoshop are you using? Surely the manual has something about alpha channels or transparency? You probably want to mask the image, make an alpha channel and then flatten it against a black background. This way your image will come out with "premultiplied alpha". (No hazey borders)

-Jon

willman256
2005.10.28, 05:42 AM
A quick move to the correct forum for this question (Designer's Studio) and a simple rename to a more descriptive thread title, and "Tada!" No more off-topic and everyone is happy. Perhaps this can be done in the future! ;)

What version of Photoshop are you using? Surely the manual has something about alpha channels or transparency? You probably want to mask the image, make an alpha channel and then flatten it against a black background. This way your image will come out with "premultiplied alpha". (No hazey borders)

-Jon
thanks for moving the topic i had no idea where it would go....

im using CS1 i could get CS2 but i dont have enough money for it... and id rather spend £500 on something else than a piece of software...

TomorrowPlusX
2005.10.28, 09:59 AM
The best way to make an alpha channel in this situation is to copy the muzzle flash image into a new channel ( "Alpha 1" ) in your channels palette. Then use the "Levels" adjuster to expand this image ( which will now be greyscale ) such that the black remains black and the grey/white goes white. You'll have to adjust it accordingly.

Then, make a layer under your muzzle flash which is mostly the color of the edges of your flash. Say a bright yellow. Then set alpha channel for your muzzle flash to the "Alpha 1" you made in your channels palette. ( do this by option-clicking the alpha channel in the channels palette and then selecting your muzzle flash and clicking the mask button on the bottom of the palette ).

You might want to gaussian blur this mask and futz a little.

Then, use the "SuperPNG" PNG exporter ( google for it ) and let it export a PNG with the alpha channel. There are two versions of SuperPNG, select the one with "Old school alpha channel support ).

teh1ghool
2005.10.28, 09:59 PM
Couldn't you just make your flash on a blank layer and in Dim3 set the alpha in the script to be like .75 or something and have a time making it go to like 0? I'd think that would be MUCH easier.

PowerMacX
2005.10.28, 10:29 PM
If your level is pretty dark, you could try using additive blending. Otherwise, the blurred alpha channel TPX described should do the trick.

Max
2005.10.29, 04:31 AM
I think it would be better and faster to create your own muzzle flash. It doesn't have to be detailed or beautiful... we'll only see it for a fraction of a second.

TomorrowPlusX
2005.10.29, 09:21 AM
He would still get a black box around it. The *easiest* way, without worrying about alpha channels, is to set the blend mode as such:

glEnable( GL_BLEND );
glBlendFunc( GL_ONE, GL_ONE );


I don't know how you'd do this in Dim3...