• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Arun8897 · Jul 28, 2018 at 05:25 PM · texturegraphicstexturessizestorage

PNG vs TGA Which Should I Use

My Texture Size differs while using different formats. For Example Both are same texture with dirrent formats (.tga) file size is 16 MB (.png) file size is 7 MB

I want to know if is use .png file format can I reduce the game size or .tga will also give the same result (regarding storage size)

Can anyone help me?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
6
Best Answer

Answer by Bunny83 · Jul 28, 2018 at 05:59 PM

Well first of all why would anyone nowadays use targa to store images? It's either uncompressed or only run length encoded and depending on the image content that might not help at all. PNG is a lossless image format with much better compression.


However if you want to use TGA, just use it because it doesn't affect the build size at all. Unity stores the images in an appropriate hardware supported texture format for the given build platform. If the texture is compressed at all and which max resolution it should have can be changed at the import settings of each texture.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Arun8897 · Jul 29, 2018 at 08:09 AM 0
Share

Can you explain me why this option is for ?alt text . I want to know whether it will reduce memory on storage or in ram? .

avatar image Bunny83 Arun8897 · Jul 29, 2018 at 07:12 PM 0
Share

Uhm have you missed my second paragraph? If you have you may want to re-read it again, carefully and also read the linked documentation page. Again, the texture source file you put into a Unity project is not the one included in the build. The textures are converted into an appropriate format for the build target platform. So it doesn't matter for the build what the source format is. You can use B$$anonymous$$P, PNG, TGA, PSD, ...

avatar image mabulous · Nov 24, 2020 at 01:06 PM 0
Share

why would anyone nowadays use targa to store images

See my answer, there are cases where TGA will be better suited than PNG, since PNG is not truly lossless

avatar image
2

Answer by mabulous · Nov 24, 2020 at 01:04 PM

There is one very good reason to use TGA over PNG:

most PNG compressors set the RGB component of completely transparent pixels to either complete black or complete white, which is fine so long as:

  • the alpha component is actually used as transparency

  • there is no filtering applied

However, depending of how the images get filtered when downsizing, the RGB part of those completely transparent pixels may be accessed and affect the RGB value of filtered pixels that are not completely transparent, and then you'll see strange dark or bright edges.

Also if you use the alpha channel for something else than transparency (like reflectivity or self illumination or something like that) then obviously this is not going to work well with regular PNG compressors. In these cases TGA will yield the desired results.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Pangamini · Sep 23, 2021 at 10:58 AM 1
Share

This is, however, fault of the PNG compressor, not the PNG format. I agree, that this can be a pain in the ass though. Anyway, aren't there better alternatives than Targa? Tiff maybe? This seems to be a very common struggle

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

129 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

EPIC GIANT TEXTURE - possible? 3 Answers

Problem with graphics after restarting a unity application 0 Answers

Textures look terrible in game mode 1 Answer

How do I make a texture tile differently on different sides of an object? (2018.3) 0 Answers

Problem with assigning textures to quads 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges