These forums are CLOSED. Please visit the new forums HERE
PNG to TGA |
|
|
Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
|
07-11-2007 03:31
I have some images that are in PNG format 24bit with transparency. Is there a way in Photoshop to convert them to TGA format and transfer the transparency information to an alpha channel. Some areas are semi transparent. Thats the part giving me the most grief. For simple opaque/transparent PNG's I can load selection. create new layer. Fill selection with white, invert selection and fill with black. Copy that layer as an alpha channel. But it doesnt seem to work with the semi transparent areas.
|
|
Michael Bigwig
~VRML Aficionado~
Join date: 5 Dec 2005
Posts: 2,181
|
07-11-2007 03:42
I could be wrong, but I don't think you can export "semi-transparent" from PS to SL. The transparency of the texture will be taken care of in SL. It's either on or off in the export...1 or zero...
![]() _____________________
~Michael Bigwig
__________________________________________________Lead Designer, Glowbox Designs ![]() |
|
Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
|
07-11-2007 04:02
That is incorrect. Alpha transparency can most certainly do semi-transparent.
I'm not sure off the top of my head how to convert the transparency in a png into an alpha channel, but my first guess would be to lock the layer and then paint over it with a white brush. _____________________
(Aelin 184,194,22)The Motion Merchant - an animation store specializing in two-person interactions |
|
Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
|
07-11-2007 04:27
I know that SL transparency can be semi transparent as I have done that before. The alpha channel is just a shade of grey. In PNG there is no alpha channel as such. But transparency is still there.
|
|
Namssor Daguerre
Imitates life
Join date: 18 Feb 2004
Posts: 1,423
|
07-11-2007 06:41
Are you absolutely sure they are 24 bit? I have no trouble creating an alpha channel with 256 levels of grey for a 24 bit RGB PNG file with transparency in Photoshop.
I load a selection using the current document. Maintain the selection. Create a new alpha channel and fill it with white. Save as TGA using 32 bit and I'm done. To save the alpha channel I make another version and save as a PSD file. |
|
Learjeff Innis
musician & coder
Join date: 27 Nov 2006
Posts: 817
|
07-11-2007 07:51
PNG supports alpha channels, according to
PNG supports 3 modes, truecolor (24-bit, or 32-bit with alpha channel, just like TGA), grayscale, and palette ("8-bit" . You say you have a 24-bit PNG image with alpha, which doesn't seem possible. I think it has to be either a 32-bit or 8-bit image.If PS is working correctly, it should load the PNG's alpha channel the same way it would a TGA, and converting between the two file types should be trivial. I believe that internally it works using truecolor (or better) mode, using 8 bits (or more) per primary color per pixel, with 8 more bits per alpha channel per pixel. On reading the PNG file, if it's 8-bit mode, it would convert each pixel using the palette color for that pixel, and the palette would be a 32-bit color with 8 bits of alpha channel. If you email the photo to me at my username (separated by a dot) at gmail dot com, I'll see if I can convert it using GIMP. |
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
07-11-2007 08:34
Bobby, are you sure you need to convert the image? SL does support PNG now, after all.
In any case, if you want to create an alpha from your visible PNG transparency in PS, it's really easy to do. Open the image, and ctrl-click the thumbnail in the Layers palette to select everything on the layer. Then go to the Channels palette and click on "Save Selection As a Channel" down at the bottom. There ya go, instant alpha. Now, to get rid of the PNG embedded transparency, you've got two easy options. The quickest thing to do is to run the Solidify filter from Flaming Pear. You can find it in their Freebies package on their website. http://www.flamingpear.com/download.html It will turn all the translucent pixels opaque, preserving their color, and at the same time it will fill in any totally empty pixels with color data from their neighbors. This leaves you with a fully opaque canvas, so that only the alpha channel will be responsible for any transparency info. If you don't want to use Solidify, then the other option is to save out a copy of the file in a format that does not support transparency, like a 24-bit TGA Then open the new copy, drag in your alpha channel from the first file, and save the whole thing as 32-bit TGA. Either way, it's a 5-10 second operation. Solidify makes the process a little more efficient, so that's what I recommend, but the results will be the same whichever way you want to do it. _____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested. |
|
Sioxie Legend
Obsessive Designer
Join date: 11 Nov 2006
Posts: 168
|
07-11-2007 12:01
In Photoshop
Easy - Ctrl-click the layer with transparency, click on the channel pallet (with your selection still active), create a new alpha layer, then with the new alpha selected fill with white. Then "save as" TGA 32 bit. If you need more instruction - IM me in-world, when the grid is up. And I can walk you through it. _____________________
Sioxie Legend
__________________ http://secondwavefashion.blogspot.com/ www.soignemonde.com https://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=31662 |
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
07-11-2007 13:17
In Photoshop Easy - Ctrl-click the layer with transparency, click on the channel pallet (with your selection still active), create a new alpha layer, then with the new alpha selected fill with white. Then "save as" TGA 32 bit. If you need more instruction - IM me in-world, when the grid is up. And I can walk you through it. You forgot a step. If you don't solidify the colors, you can end up with undesirable results, depending on the image. Also, just so you know, you can save a few clicks by creating the channel directly from the selection, rather than creating a blank one and then filling it. And "alpha layer" was a typo, right? I don't need to get all bent out of shape and go into my standard rant about how there's no such thing as an "alpha layer" (it's an alpha CHANNEL, not a layer), and how this forum is the only place on Earth where people have this unfortunate habit of interchanging the words "layer" and "channel", right? Good, thought so. ![]() _____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested. |
|
Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
|
07-12-2007 03:06
Thanks for the replies folks. It has answered a lot fo questions. I think I did similar to the ctrl+click thumbnail of the layer by just load selection which seems to select all but the transparent. I then filled the selection with white onto a balck background layer. Then copied the layer as a new alpha channel.
Just to explain. I have been using a program called Xara3d which produces some nice 3d effect graphics for signs etc. But cant be saved as tga files. The nearest is png files which have an option of bit depths of low to 24 bit and a tick box for transparency. When loaded into CS2 there is no alpha channel present, but there is transparency in the image. So I am still not sure if its a 24 bit image with another channel tagged on or what. My dilema was the best way to get the image to a tga for SL and preserve the transparent bits. I seem to be getting there now. Chosen. Why is it advisable to use Solidify to fill the tansparent/translucent parts of the layer when I will have an alpha channel that should take care of that? |
|
Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
|
07-12-2007 04:57
Why is it advisable to use Solidify to fill the tansparent/translucent parts of the layer when I will have an alpha channel that should take care of that? I'm gonna turn this around and wonder what having an alpha channel has to do with filling in the transparent areas. The alpha channel is wholly separate from the RGB channels; indeed, that is the point of using an alpha channel, versus simply erasing the transparent areas, to keep everything separate and thus modifiable. _____________________
(Aelin 184,194,22)The Motion Merchant - an animation store specializing in two-person interactions |
|
Sioxie Legend
Obsessive Designer
Join date: 11 Nov 2006
Posts: 168
|
07-12-2007 07:59
You forgot a step. If you don't solidify the colors, you can end up with undesirable results, depending on the image. Also, just so you know, you can save a few clicks by creating the channel directly from the selection, rather than creating a blank one and then filling it. And "alpha layer" was a typo, right? I don't need to get all bent out of shape and go into my standard rant about how there's no such thing as an "alpha layer" (it's an alpha CHANNEL, not a layer), and how this forum is the only place on Earth where people have this unfortunate habit of interchanging the words "layer" and "channel", right? Good, thought so. ![]() Ok, so channel - sorry about that I haven't had any issue with my TGA files when I don't solidify colors - you could choose to flatten against a black background it before saving if your concern is a white halo but otherwise for general use this works fine. I think that everyone has their own way of doing things - but having to buy or install one more plug-in when there are alternatives that are cheaper and just as effective is just wasteful._____________________
Sioxie Legend
__________________ http://secondwavefashion.blogspot.com/ www.soignemonde.com https://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=31662 |
|
Michael Bigwig
~VRML Aficionado~
Join date: 5 Dec 2005
Posts: 2,181
|
07-12-2007 08:23
That is incorrect. Alpha transparency can most certainly do semi-transparent. I'm not sure off the top of my head how to convert the transparency in a png into an alpha channel, but my first guess would be to lock the layer and then paint over it with a white brush. Gosh, I've been using PS since...it came out, and I've never exported a semi-transparent alpha...go figure. So, you're saying I create my texture, and I set the opacity of the artwork, and then go about the standard masking, and it will export with the opacity % that I set? _____________________
~Michael Bigwig
__________________________________________________Lead Designer, Glowbox Designs ![]() |
|
Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
|
07-12-2007 08:26
No, that's not the right way to do it. Basically, you know how when you paint white in the alpha channel those pixels are fully opaque and black is fully transparent? Well, paint grey on the alpha channel and those pixels are semi-transparent.
_____________________
(Aelin 184,194,22)The Motion Merchant - an animation store specializing in two-person interactions |
|
Ethan Habsburg
Shop Keeper
Join date: 2 Jan 2006
Posts: 98
|
transparent pngs in sl
07-12-2007 10:40
SL now handles transparent pings. I use them now when using certain programs that do not export transparent tga format.
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
07-12-2007 17:18
but having to buy or install one more plug-in when there are alternatives that are cheaper and just as effective is just wasteful. How could you possibly define the Solidify filter as "wasteful"? First of all it's free, so your money concern is not valid. Second, installation takes 20-30 seconds if you move your mouse at a snail's pace, 2-3 seconds if you move like a human being, and it only has to be done once. The file itself is a whopping 84k, so you can't really say you're "wasting" disk space with it. It takes about 30 seconds or so to download the Freebies package, which again is a one-time operation, and the package includes a lot of very useful things in addition to Solidify. Me, what I would define as "wasteful" would be not to take advantage of the opportunity to get a bunch of free stuff that will make your texturing life faster, easier, and arguably more effective. Maybe my logic is not in tune with yours though; I can live with that. Anyway, to answer the question, yes, my concern is haloing. For the majority of PNG to TGA conversions, it probably won't be an issue, but for some it will. I prefer to talk about methods that are as universally successful as possible when outlining any "here's how you do this" kind of thing. Since there's no harm in solidifying an image that doesn't need it, but there would be harm in not solidifying one that does need it, and since it takes literally less than a second to apply, I think it makes sense to include it as a step. That's all. _____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested. |
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
07-12-2007 18:33
I'm gonna turn this around and wonder what having an alpha channel has to do with filling in the transparent areas. The alpha channel is wholly separate from the RGB channels; indeed, that is the point of using an alpha channel, versus simply erasing the transparent areas, to keep everything separate and thus modifiable. To get rid of that, you run a solidify filter. I admit, I've never heard of that filter and have always solidified by-hand. Basically, I use the smear brush to smear outwards from the edges of my cut-out. Reading about it, I imagine the solidify filter does the same... I need to grab a copy. |
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
07-13-2007 07:50
I believe it's because at some point in the conversion to TARGA or upload to JPEG process, the transparent area gets filled with white. The transition between solid and full alpha gets smoothed or ramped a little. Therefore, if you have a cut-out of a red shirt, there might be a thin white line around the edges between fully solid and fully transparent. Exactly, DoteDote. As I said earlier, this won't be the case for all PNG->TGA conversions, as it's entirely possible in a PNG to have the transparent parts actually be colored, not just white. But it will happen for SOME images. It all depends on how the original PNG was made. For your T-shirt example, here are two (of the many) ways it could go. If the creator started with a wholly red canvas, and then then selectively made the "empty" areas transparent without actually removing the red, then you would't get a halo. The whole canvas is still red, even though you can't see parts of it. However, if it was a case of starting with a pre-existing transparent background, and then slapping the red areas over it (which is how I think most people in SL are used to working), then you WOULD end up with a halo since the background has no color, and TGA interprets absence of color as white. For the first one, solidifying would make no difference to the final output, so there's nothing to lose. For the second, solidifying would rescue the image from the halo, so there's everything to gain. Either way, you can't go wrong by solidifying. To get rid of that, you run a solidify filter. I admit, I've never heard of that filter and have always solidified by-hand. Basically, I use the smear brush to smear outwards from the edges of my cut-out. Reading about it, I imagine the solidify filter does the same... I need to grab a copy. Solidifying by hand is fine, but the filter does save a lot of time. What it does is first it takes all pixels that have color data and makes them 100% opaque, and then for any pixels that don't have color data, it fills them in with a blend of the colors from their closest neighbors. Again, it's nothing you couldn't do by hand; it just does it a hell of a lot faster. _____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested. |