- Home /
The question is answered, right answer was accepted
Stop Texture2D Compression
I am trying to import PNGs from a file (outside of the project) as Texture2Ds. I am then trying to use that Texture2D for retrieving data as well as displaying it to the user for editing as a Sprite. My problem is that the Texture2D is being compressed to 25% size, even though it is already really small (16px x 16px). I have tried to find a way to stop Unity from compressing the Texture2D, but the only ways I can find are in the editor, which won't work for me because I am importing the images at runtime. I have found out how to change the filterMode to Point to keep it from blurring when seen as the sprite, but it is still compressing to 8px x 8px.
Does anyone know if there is a way around this compression?
.
Edit: I found the solution. Unity was auto-generating mipmaps. I disabled this by setting mipChain to false in the Texture2D constructor. Now the image is full-sized as a sprite.