Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Different Sprite Size (Explorer vs Inspector)

Discussion in '2D' started by JosephMGS, Dec 29, 2019.

  1. JosephMGS

    JosephMGS

    Joined:
    Nov 5, 2019
    Posts:
    20
    Hi All,

    My PNG sprite size is 6kb in Explorer but when I check in the Inspector it says 3.1mb. Which one is true and affect my build size? I'm using 2019.2.17f1. Thanks.

    upload_2019-12-29_13-37-6.png
     
  2. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    What compression do you use for your file?

    I have a png file that is 1.48 mB in Windows Explorer and 2.3 mB (high quality compression, crunch compressed quality 100) in Unity. If I use no compression for the same file, it goes up to 9 mB in Unity.
     
    JosephMGS likes this.
  3. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @JosephMGS

    You should only worry about texture sizes, if you use uncompressed textures. Using compressed textures will add those to build, not source texture asset, unless you add source file to Resources folder or something like that.

    See:
    https://docs.unity3d.com/Manual/class-TextureImporterOverride.html

    Formats like ancient DXT format are lossy, they compress the source texture to compressed format bit like jpeg image, and then it is read runtime by GPU (and also stays compressed in video memory IIRC).

    Also, you have a NPOT texture size - another issue, but you should read about using POT (power of two) sized textures, these will be more optimal and using POT sized textures is the "standard" way to author textures that are suitable for 3D graphics / GPU use.
     
    Last edited: Dec 29, 2019
    JosephMGS likes this.
  4. JosephMGS

    JosephMGS

    Joined:
    Nov 5, 2019
    Posts:
    20
    Thank you guys. The above example is a noncompressed texture by the way. To clarify with a simple question;

    If I don't compress my 6kb PNG image does that mean it can go up to 3mb in size within build?
     
  5. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    The size that will be used in build is most probably the size mentioned by Unity.
     
    JosephMGS likes this.
  6. JosephMGS

    JosephMGS

    Joined:
    Nov 5, 2019
    Posts:
    20