Search Unity

White Edges on Sprites Loaded from PNG at Run-time

Discussion in '2D' started by akasurreal, May 13, 2017.

  1. akasurreal


    Jul 17, 2009
    When I use use Texture2D.LoadImage at run-time, I have white edges around my sprites that I don't get if I load the same exact sprites in the Editor. I know this has to do with pre-multiply alpha and there are ways to pre-process the source image to avoid this, but the Editor does not have this issue and I would prefer not to have to do extra processing on all my images. Also, this is for a tool that allows users to select their own sprites, so I don't have control over those images, nor do I want to explain some processing step to my non technical users.

    I have seen a few other threads and unity answers posts regarding this, but the only thing I am seeing is source image processing which as mentioned above is not an option.

    I have tried messing with the alpha settings on the texture to no avail. Is this some kind of limitation of run time texture/sprite loading or some setting I can fix? The editor handles these files perfectly, so I know Unity is at least capable of doing what I want on some level.

    Thanks for any help!
    (Unity 5.6.0p4)

    Other similar issues:
    Last edited: May 13, 2017
  2. DanRP


    May 26, 2013
    I'm having the same issue...
  3. ObelardO


    Feb 20, 2015

    Attached Files:

    e140games and akasurreal like this.