- Home /
Unity 5.1 Distorted image after download from web
When I load my png after compressing with tiny png, they get distorted( all purple and transparent) http://s22.postimg.org/b39g0bhn5/Screen_Shot_2015_06_28_at_10_39_50_AM.png
the background for example should be blue
http://postimg.org/image/fez234o6d/
this only happens when i use pictures that got compressed by tinypng.com and only after i updated to unity 5.1. Im downloading the image with WWW class and loading texture using Texture2D. is this problem known to anyone?
Answer by Kowciany · Jul 08, 2015 at 10:16 AM
Have the same problem ! On Unity 5.1 on 5.0 i downloaded file by WWW and get texture by www.texture. For now I have bad colors and no transparency on PNG. The only thing which works as I tried to fixed this was getting texture this way Texture2D texture = new Texture2D(32, 32, TextureFormat.DXT5, false); www.LoadImageIntoTexture(texture);
Try to mashup with TextureFormat. for me DXT5 worked but unfortunetly it is comressed format so I lost few colors. Checked info here: http://docs.unity3d.com/ScriptReference/WWW.LoadImageIntoTexture.html