Jump to content

"proper" alpha channel to eliminate border


dpakatheman

Recommended Posts

First of all, let me just say that PDN is an amazing tool.

The issue I'm having is that when I try to create a partially transparent texture for use in Unity 3D, I get a gray border inside of Unity that is not visible in Paint.net. It appears to be a well-known issue, and there are lots of instructions, video tutorials, etc. for how to deal with the problem when using Photoshop. See the following post for more information:

http://forum.unity3d.com/threads/80614-Texture-formats-and-alpha

The basic theme of the solution is that you need to create a "proper" alpha channel and not rely on the "checkered background" that exists in Photoshop. Is it possible to achieve the same thing with Paint.net?

Link to comment
Share on other sites

Paint.NET does have a "proper" alpha channel, right down to the proven mathematical formulas used, so I think we've got a mismatch on terminology. In other words, I'm really not sure what you're asking.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Paint.NET does have a "proper" alpha channel, right down to the proven mathematical formulas used, so I think we've got a mismatch on terminology. In other words, I'm really not sure what you're asking.

I believe the "proper" alpha channel that the OP is referring to is the alpha "channel" in the channel palette which is actually a mask.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

I looked into this a bit more, and at least this time I have a well-defined question.

I'm trying to fill the RGB channels of my image with data, while keeping the transparency at 100%. Using the "More" button on the Colors window, I can set the transparency of my colors, but when I set the Alpha to 0 it doesn't seem to be filling in the RGB channels with any data. This is difficult to tell directly from Paint.net (after all, how can you tell if something is there if it is 100% transparent), but it is obvious when I load the file up into Unity (or another app that is sensitive to what is in the RGB channel even when the pixels are fully transparent.) Setting a transparency value of 1 will fill the RGB channels with data in Paint.net, but setting the transparency at 0 will not fill the RGB channels.

Does this make more sense? Is there a way to fill the RGB values with data and have 100% transparency?

Edited by dpakatheman
Link to comment
Share on other sites

I don't know what file type you need this to be.

With PNG file type:

Make your layer with RGB values at full opacity.

Fill a new layer with white, copy the white layer into the clipboard, delete the white layer.

Apply the Alpha Mask Import plugin effect to the RGB value layer, with all boxes checked.

This will give full transparency.

Save as Optimized PNG, using the OptiPNG file type plugin.

This will give zero opacity with RGB values preserved as verified by Color Picker tool.

Link to comment
Share on other sites

Works great, thanks so much. And the color picker tool is a great way to verify that the RGB values are still in there without going to an external application, which greatly simplifies the process of finding out what operations cause me to loose the RGB values (flattening for example).

Link to comment
Share on other sites

I can set the transparency of my colors, but when I set the Alpha to 0 it doesn't seem to be filling in the RGB channels with any data.

That's because you have blending enabled. In the toolbar, find the little flask icon, and click the arrow to choose between Normal Blending and Overwrite.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

No, they show up exactly as they exist on the layer. If you laid down a transparent black (A=0, B=0, G=0, R=0) then the color window will show black, and the alpha slider will be 0 as well. If you laid down a transparent red, then it'll show something else. When you go to save, you will probably lose color information, because mathematically it is the case that all colors with an alpha value of 0 are equivalent, and thus the layer compositing cannot preserve that information.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

When I Paintbucket fill a new layer with Red (or other color) at zero Alpha - Transparency in the Color window, it Color Picks as black with zero Alpha - Transparency.

In Overwrite mode.

This, even before saving.

=====================================

If I make a zero opacity red (or other color) layer as described in post #5,

saving as Optimized PNG, it produces a zero opacity layer with color values preserved.

This is based on my actually testing this, not on my belief.

========================================

Color Picking the attached OptiPNG will show different colors at different locations, all zero opacity.

AlphaColorOptiPNG01.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...