"Non power of 2" Textures - How to access original size?


I am building some kind of virtual museum with Unity. All the original paintings I want to show are not power of 2, so I chose the option "toSmaller" in the Texture Importer to keep the performace high. The problem is: Within the game, I also want to show the paintings as 2D Textures, so I will have to access their original texture width and height. By now, the paintings are distorted, because the textures are saved as 512 x 1024 or something like this. So, a statement like:

print("Size is " + painting.width + " by " + painting.height);

gives me 512 x 1024, but not the original size. Is it possible to access the texture's origial size?

I would set those texture as 'GUI' so that they don't get resized at all. But if you absolutely need them to be power of 2 for memory usage issues, then got for the duplication solution, have one version 'power of 2' and one version 'GUI', switch to the latter when you're going for quality.

I am not sure, what you mean by setting the texture as 'GUI'. Can you explain that? Thanks a lot!

Easiest way to solve this is to duplicate the texture asset and set the power of 2 option to none, then use that one for your undistorted textures and the other one for the rest.