• Bugs
  • Problem when exporting atlas

Related Discussions
...

Different ways to create atlas with different result and one is wrong:

1) Select Export -> Json ->select create atlas and then click Export, then I find images in the atlas file have wrong alpha part, see the first attachment.
2) Do not change any texture packer settings, Select Texture packer... in the menu and pack the images, the result is ok, see my second attachment

The first one looks like premultiply alpha is checked. The second one looks like it's not.

Looks like the two different defaults might be a bug.

But the first one is not "wrong". It's just packed with a premultiplied alpha channel. This is ideal if you also use a shader with premultiplied alpha blending (which is faster to render). The first one will look perfectly fine in-game. No seams or black edges or anything. But you need to use the correct shader based on what you exported.

Pharan wrote

The first one looks like premultiply alpha is checked. The second one looks like it's not.

Looks like the two different defaults might be a bug.

But the first one is not "wrong". It's just packed with a premultiplied alpha channel. This is ideal if you also use a shader with premultiplied alpha blending (which is faster to render). The first one will look perfectly fine in-game. No seams or black edges or anything. But you need to use the correct shader based on what you exported.

Thanks for your reply. I'm not familiar with the shader you described, I'm confused a little, is that
a) use premultiplied alpha channel has many benefits
or
b) we can use premultiplied alpha blending to achieve some color result we want

Forgive my bad English if my question is not clear, maybe the question should be: In what situation, its better to use premultiplied alpha channel

It's A.

Using premultiplied alpha has benefits. Specifically, it's faster.

You don't need to worry when you see those black outlines because they don't come out in the game. You will only see them in the image viewer.

What you need is the correct shader/render settings to use it. But it's a very common way of rendering graphics so most frameworks and engines will have it built-in. (Except maybe if you're using a browser-based engine/javascript)

What game engine are you using? Maybe some other users can help you use premultiplied alpha.