Search Unity

Default Texture to Sprite increases size by 2-3 mb per image

Discussion in 'Editor & General Support' started by iubisoft, Jun 22, 2017.

  1. iubisoft

    iubisoft

    Joined:
    Jul 18, 2013
    Posts:
    6
    Hi, there Unity developers.
    I have a small problem and I want to understand why this is happening!
    Importing an Image as a texture in Unity3d sets the size at 100 kb (normal size shown in finder)
    Changing the Image type to Sprite2D increases the size of the image to 3 MB which is a lot considering the number of images one has to use. Using a sprite sheet might be an option but I want to exclude that option for now.
    Do you have any idea why this is happening and how can I make the Sprite keep the original size without compressing the Image?

    Thank you in advance!
    Best regards.
     
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    Original size is compressed, not pixel-by-pixel data.
    Try convering original image into bitmap image (.bmp) and then compare sizes.
     
  3. iubisoft

    iubisoft

    Joined:
    Jul 18, 2013
    Posts:
    6
    @Marfab tried just now, not working! :( 2mb to 9mb, thanks for answering
     
  4. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,243
    No, I meant comparing original image to .bmp image.
    see that it went from 100kB to 2MB, closer to what unity makes it. Now you also have to understand that Sprite2D isn't just raw image data. Some overhead here, some overhead there and you get to 3MB.
    It's completely normal.
     
  5. iubisoft

    iubisoft

    Joined:
    Jul 18, 2013
    Posts:
    6
    no success, I'll be waiting for other answers! Thank you anyway!
     
  6. Moonjump

    Moonjump

    Joined:
    Apr 15, 2010
    Posts:
    2,572
    As Marfab says, the original is compressed, not pixel-by-pixel data.

    Or to put it another way, one is optimised for data storage, the other for real-time use.

    Unity stores the data ready to be used in the game. That format is much more memory intensive.
     
  7. iubisoft

    iubisoft

    Joined:
    Jul 18, 2013
    Posts:
    6
    that makes sense! Thank you moonjump!