what's the difference between alpha channel and tranparency channel?
Asked Answered
P

3

8

I thaught they were the same.

But these days I found png and targa textures behaves differently in UE4.

Today I read something at Adobe,

Alpha channels can contain anything, while transparency is a specific channel relationship.

And it says also,

(Transparency channels) Each image pixel is represented by a set of numerical values for the visible colorants and one additional numerical value containing the opacity information.

This confused me a lot.

Do they save different data? Does alpha channel is "stronger" than transparency channel?

Puncheon answered 29/1, 2017 at 2:14 Comment(0)
A
1

Short answer: Anything can be in the alpha channel. The name "A" or "alpha" doesn't really mean transparency, or anything else really, it's just the name that refers to the fourth channel of the image. So you can put anything in it, depends on what you want in it.

Long answer, if you want to understand it in more depth, is below.

Image channels are just a container with some data. You can have any number of channels, depending on what the format allows. For example, JPEG files can have three, PNG can have four. Some formats, like OpenEXR, which is used widely in the film/CG industry, can have very many.

The first three channels are usually called as R, B, and G, since they're mostly used for color images, to represent the amounts Red/Green/Blue. But of course, since they're just data, they don't have to represent that, you can put anything in them. For example, in a technique widely used in the game industry to optimize, people put metallic and roughness values in the first two channels, instead of Red and Green amounts. See https://www.youtube.com/watch?v=4-EsLM40_9o for more details.

If you are creating the image, of course you can decide yourself what to put in each channel. It all depends on the use case.

Here are some example use cases:

  • If you use your image to depict a grayscale photo, one channel can be enough. It will just represent how bright each spot of the image is.
  • If you use your image to depict a color photo, you can use three channels to depict Red/Green/Blue. This is known as additive color, since adding all of them makes white.
  • For printing a color image, four channels to depict Cyan/Magenta/Yellow/Black are used. The specific reasons why these ones, and why four, are out of scope for this question, but suffice to mention they're known as subtractive colors, since subtracting them from white makes Red/Green/Blue/White.
  • If you want to depict a transparent colored image, the easiest way is probably go with RGB for the first three channels, and transparency in the fourth. This is the most widely used "RGBA" approach, in png and tga images for example.

png and targa textures behaves differently in UE4

They don't, if all channels contain the same data. If someone put something else, apart from transparency, in the fourth channel, then they would. But so would two different png images.

Althorn answered 15/12, 2021 at 23:18 Comment(1)
To add: the Adobe quote is saying: not all alpha channels are transparency channels, they are only transparency channels if you decide to put data about how transparent something is in there. If you put how glossy the image is in there instead, you won't call it "transparency channel", but "glossiness channel", so that it's clear what the channel is used for. Since it's still the fourth channel, you can still call the "alpha", of course, since alpha is just the word for "fourth channel".Althorn
F
0

with alpha channel you can edit individual color channels. Depends on the color mode.

Fatwitted answered 21/1, 2021 at 9:50 Comment(0)
G
0

It seems that png allows for a different method ofr transparency https://www.w3.org/TR/PNG-DataRep.html

rather than in the alpha channel like all previous file formats it uses a tRNS chunk in the beginning of the file determine transparency. Since the png was designed for web rather than print it is able to use a completely different method not based on analog techniques like the alpha channel/mask technique

Gopher answered 8/12, 2022 at 15:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.