Jump to content

Transparent background is leaving unwanted outlines around image


Recommended Posts

Hi,

 

I'm trying to create a texture of a latticed wooden fence for a community video game map but am getting weird outlines around the non-transparent parts, see pic at bottom.

 

What I'm currently doing is this;

- import the .png file

- create a new empty layer, fill the background with black and then set the opacity to 1

- Merge the layers and then export as a .tga file

 

I asked around a discord server on what to try out and got the following advice however I have no idea what this is asking me to implement / how to go about it;

"The trick is to paint the background the same color as the fence. So you need to have the transparency mask on the alpha channel and export as a .tga"

 

Note: The top left part of the image is what it looks like in paint.net, the top right is from the games texture browser after I've imported it and the bottom is from ingame

 

lattices_lowres.jpg.996d064e641fb06c6361145cf9dd0651.jpg

Link to comment
Share on other sites

Hello @Maharero and welcome :)

 

I would use this plugin called AA's Assistant on the initial lattice image first.  I always use this plugin on every step when making something, and even do it at the end too.  But, it's important to do your work on a new layer, until you have everything just right, then flatten the image.

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

1 hour ago, ardneh said:

If you place the original lattice .png above a full opacity black layer, is the white outlining visible?
 

There's no more white outlines after doing that which shows that there's no native white colouring in the image itself, it gets added somewhere throughout the process. I've attached a pic that shows how it looks like in the game editor. I'm starting to think that the artifacts may be getting introduced by the other program I use that converts the paint.net exported .tga file into a material format that the game requires (I'm using VTFEdit to create .vmt files for the source engine). In that case I might have to go an alternate route and actually model the lattices themselves (time consuming because it's curved).

 

Quote

I would use this plugin called AA's Assistant on the initial lattice image

I'm new to paint.net so havent used any external plugins yet so thanks for the link. I tried what you recommended but unfortunately I still had the same issues, like I mentioned above I'm starting to think that the issue doesnt lie with how im using paint.net. I'm at least learning new things by doing this so its not a complete waste of time 😃

 

Thank you both for the help

no_transparency.jpg

Link to comment
Share on other sites

2 hours ago, MJW said:

If it's the same issue as the previous thread, it's actually a bug in the game, which is mishandling transparency

 

 

Thanks for linking that thread - it's definitely the same issue that I'm encountering.

 

I've used your plugin, the manual method mentioned in that thread, and also installed and tried out GIMP as that poster suggested it worked by default and all 3 methods failed me. At this point I'm convinced it's a limitation of the game engine when it comes to these types of transparent textures. Cheers everyone for the help

 

Link to comment
Share on other sites

22 minutes ago, Maharero said:

I've used your plugin, the manual method mentioned in that thread, and also installed and tried out GIMP as that poster suggested it worked by default and all 3 methods failed me.

 

One thing worth trying, just to help figure out what's going on, is to read the .tga file back into Paint.NET, then use the Color Picker tool to sample the transparent area. I'm wondering if perhaps even though the transparent pixels are changed to transparent black in PDN (or Gimp), they're changed back to transparent white when they're saved in the file. Does the program accept any other file formats you could try instead of .tga?

Link to comment
Share on other sites

I've confirmed with the color picker tool before exporting that the transparent pixels were changed to black, then exported it to a .tga, then imported it again to check the transparency. It was still transparent black after importing so the conversion did not change things.

 

It's considered best practice by the community to use .tga for the program im using however it also accepts other formats. Unfortunately I still get the same issue if I use the default .png filetype for the program instead of a converted .tga version.

Link to comment
Share on other sites

This might just be incorrect alpha blending/compositing in the game engine. It may even be treating the pixels as being premultiplied, which will definitely cause colors to appear the wrong shade but with the right alpha. Many drawing/rendering frameworks let you interpret 32-bit BGRA pixels as either straight or premultiplied without any warnings or conversions needed (it's implicit, in other words). It's very easy to get this wrong at any point in your pipeline.

 

For example: in straight alpha, (128, 128, 128, 128) is gray at ~50% alpha. In premultiplied, it's white at ~50% alpha.

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

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...