Search Unity

Slight white edge around all transparent sprites

Discussion in 'iOS and tvOS' started by drahn, Jul 30, 2009.

  1. drahn

    drahn

    Joined:
    Jun 19, 2009
    Posts:
    16
    Has anyone seen a constant slight white edge around all their transparent sprites? Is this some other compression issue?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Probably you're relying on transparency instead of using alpha channels. There's a bunch of discussion on this if you do a search.

    --Eric
     
  3. drahn

    drahn

    Joined:
    Jun 19, 2009
    Posts:
    16
    Yes, I am using transparency. Are you suggesting that the basic feature of material transparency in unity does not function as documented? Could you assist a little further by providing what topic you are referring to that I search on?

    I am not a filter programmer and dont know the first thing about them.
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Are you using .psd? This always adds a white outline around it's transparent textures (Unless you use an alpha channel). The best thing to do is to export it as a .png file. PNG's don't seem to add the white outline.
     
    kirbyderby2000 likes this.
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Here is one topic. As mentioned there, it's an issue that's not limited to Unity; if you haven't defined the color of the pixels, they have to default to something, which in the case of Photoshop files is white. If you use an alpha channel instead of transparency, then you get to control the color of all pixels, so you avoid the issue. You don't have to program any filters. If you use .png, you still have the same issue, but you can choose the matte color instead of white. Also with .png files you can't use layers, so I'd recommend using an alpha channel. It's an extra step, but overall it's the easiest and best solution.

    --Eric
     
  6. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
  7. kirbyderby2000

    kirbyderby2000

    Joined:
    Apr 28, 2017
    Posts:
    35
    Thanks a lot for this! The white outline artifacts were driving me crazy and I wasn't aware using PSD files would be problematic.


    I also want to mention for anyone else that may stumble upon this, there is actually a feature in the export setting specifically for PSD files: "Remove Matte (PSD)".

    This gave me the same quality result as exporting a PSD file to a PNG file with less effort.

    PSDFileExport.png
     
    pabloaparicio likes this.