Sprite.Create looks compressed

I had been using GUI.DrawTexture for some images before and I’m currently trying to redesign with the new GUI…
I need to create the sprite on the fly, not in the editor but they appear as if they’ve been imported compressed or possibly with mipmaps.

So I still download the png from my server and create Texture2D using


Using this texture in GUI.DrawTexture behaves exactly as I expect it to.

Now I have a panel under my canvas with an Image component which I need to set in code

gameobject.GetComponent<Image>().sprite = Sprite.Create(myTex, new Rect(0, 0, myTex.width, myTex.height), new Vector2(0.5f,0.5f));

The image this way is very blurry as if it was imported compressed as I said above… Anyone know what I’m doing wrong here?

How are you creating your texture? This is where the error is. You need to set the proper TextureFormat when creating the texture. Chances are you are currently using default which is usually compressed. What you’re looking for is TextureFormat.ARGB32