Get rid of white background?

Now, I will warn you beforehand that this is probably a pretty stupid question, but I’ll assure, I have done my fair share off Googling and still can’t wrap my head around this.

I’m working on a menu for a game, and in this I want the game’s logo at the top. I have PNG/Targa-files with the only the logo and a transparent background and nothing else. Just for increased understanding, to illustrate, here is how it may look like in Photoshop:

Now I want to import it. Fine. Import the texture. It adds a white background. Meh. >:
Create a material out of it and the white background is still there. It shouldn’t. Why is it? How do I get rid of it? It can’t look like this:

How do I just get rid of the white background? It’s annoying, as I feel like I should be able to solve it so easily. Someone please help!

Did you add an alpha channel in Photoshop?

Go into your material and change the type from Opaque to Masked, then plug in your alpha channel from your texture into the Opacity Mask slot.

1 Like

I had the same question a week or so ago, here’s the thread that should explain it (post #8 should help): Glass with Decals help - Rendering - Epic Developer Community Forums

Thanks for your answers! I tried what you said, darthviper, with a picture of a logo I got from our Art Director and it worked perfectly! But it did not work with the logo I had made in Photoshop, but I’m going to guess it’s because I hadn’t made an Alpha channel, like Gigantoad said, but that should be fairly easy, I guess! So thanks for your answers!

Alpha channels for TGA files are kind of weird and tacked on.

There’s no reason not to use PNG for everything. It’s true color, lossless, has great alpha support, and uses far less space than TGA files.

Alpha channels for TGA files are kind of weird and tacked on.

There’s no reason not to use PNG for everything. It’s true color, lossless, has great alpha support, and uses far less space than TGA files.
[/QUOTE]

And it works flawlessly with UE4 I assume? That’s good to know.

Alpha channels for TGA files are kind of weird and tacked on.

There’s no reason not to use PNG for everything.
[/QUOTE]

I have to disagree.

This only applies to Photoshop/Adobe apps:
The alpha in a .tga is treated simply as a fourth color channel (RGBA) PNG (from Photoshop at least) treats alpha as a premultiplied mask. That means that PNG files work well for very specific needs, such as UI elements that require a pre-multiplied alpha. TGAs allow much greater control over the actual alpha of an image, as well as the premultiplied color. This can ensure the artist is getting exactly what they intend. You can also use the explicit Alpha in a .tga as a fourth channel for effects that aren’t specifically alpha or opacity masking. Of course, if you’re not using Photoshop or are using some 3rd party plugins with PS, you can treat .png files exactly the same way as .tga files.

Also, while .png files are smaller than .tga files, they are slower to process (Opening and saving) as they have a very slow compression system. This isn’t a huge problem for most things, but a 4096x4096 .png is pretty slow. I’m probably biased as I deal with image sequences and the difference is night and day (However, I use .exr files for that now so that’s a WHOLE other ball of wax)

With all that said, .png files are certainly easier to learn with as they are more WYSIWYG from the photoshop viewport to UDK, but TGA files are used more ‘professionally’ because they are more explicit.

BTW, here’s the plugin for PS that allows you to use an alpha channel (rather than the transparency) in a .png:

What said. I prefer TGA over PNG any day.

Thanks for the SuperPNG Link .:slight_smile:

You can also use the alpha channel in PSDs. It’s recognized by Unreal.
(Using just transparency in a layer will give you white borders. A separate channel solves the problem)

Googling around and this thread is the most relevant result I can find.

This needs to be fixed in UE as this behaviour is wrong. PNG has three colour channels and an alpha channel, therefore the colour in partially-transparent pixels must continue to be treated as absolute. Currently it appears that transparent pixels are treated as if the background is white. Transparent PSDs have the same issue.

It can be fixed in photoshop and imported as a PSD with an extra alpha channel, but it’s a lot of work.

1 Like

The transparency of a PNG is not actually an alpha channel. That’s why using a different format with an alpha (like tga) can often be better since you can fill those pixels with the color you want to avoid fringes

Not quite right. That’s a misunderstanding of the difference between straight and pre-multiplied alpha. A PNG should never display a miscoloured fringe unless the fringe is in the colour data. It’s not a problem with the format as a PNG pixel is still just RGBA.