# TGA vs PNG (for textures)

**URL:** <https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211>\
**Category:** World Creation\
**Tags:** unreal-engine\
**Created:** [March 14, 2015, 3:33pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211 "2015-03-14T15:33:16Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [January 26, 2017, 12:01pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/22 "2017-01-26T12:01:31Z")

</div>

**PNG**

- Smaller file size (lossless compression)
- Less control over transparency since it’s not stored as a separate channel.
- Modifying transparency is a pain in the \*\*\* in PS.

**TGA**

- Larger file size (can use RLE compression, is lossless)
- Full control over transparency, since it has a discrete alpha channel.
- Modifying transparency is easy in PS.

**TIFF**

- Large-Small File size (can use compressed or uncompressed, lossless)
- Full control over transparency, due to discrete alpha channel.
- Modifying transparency is easy in PS.

**PSD**

- Usually, huge file size (contains all info as layers, as well as channels for each layer).
- Full control over everything, if it’s a layer.

^ The only differences that matter.

Compression and size makes no difference whatsoever to your runtime game speed, since everything is uncompressed then converted to DXT/BC7/RGBA format anyway when imported. TGA is the preferred format for most people since it has a discrete alpha channel that you can bring into something like PS and modify it there, and since it’s uncompressed it’s also faster to open and save (not that that’s an issue for modern PC’s usually), AND textures can be rebuilt faster in UE4.

File size only makes a difference to the amount of space your EDITOR project takes up on disc, NOT the packaged game. For consistencies sake, I’d stick to TGA personally, but TIFF is a good format if your conscious of source control / disk space.

---

<div class="post-metadata">

**Author:** ![KVogler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KVogler](https://forums.unrealengine.com/u/KVogler)\
**Post date:** [January 26, 2017, 1:13pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/23 "2017-01-26T13:13:52Z")

</div>

Also on the “pro” side of TGA:  
It only has a simple 18 byte header. So its a nice format for creating custom texture creating/editing tools…

---

<div class="post-metadata">

**Author:** ![Luos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/luos/32/918700_2.png) [@Luos](https://forums.unrealengine.com/u/Luos)\
**Post date:** [January 26, 2017, 1:20pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/24 "2017-01-26T13:20:32Z")

</div>

I prefer to avoid alpha channels where possible, because they get their own unique compression while RGB gets combined together.  
Resulting in an alpha channel taking up the same amount of space/memory as RGB combined.

for that reason I tend to combine three Alpha channels into a new RGB texture. (or if I dont need metal, put the mask in the M of RMA)  
that can actually save quite a bit of size over the course of a project.

that said, if I do need a very crisp grayscale or mask, I use the alpha channel.  
Occasionally I even save a seperate grayscale or mask with the alpha-only compression, removing the RGB info so if I do need to use the grayscale/mask in multiple materials, it doesn’t need to load useless RGB info.

---

<div class="post-metadata">

**Author:** ![Raildex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raildex](https://forums.unrealengine.com/u/Raildex)\
**Post date:** [January 26, 2017, 1:25pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/25 "2017-01-26T13:25:35Z")

</div>

Somewhat related:  
Is it possible to have uncompressed textures in a cooked build?

---

<div class="post-metadata">

**Author:** ![Luos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/luos/32/918700_2.png) [@Luos](https://forums.unrealengine.com/u/Luos)\
**Post date:** [January 26, 2017, 1:40pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/26 "2017-01-26T13:40:02Z")

</div>

> [@Raildex\_;656664](#):
>
> Somewhat related:  
> Is it possible to have uncompressed textures in a cooked build?

yes.  
there are uncompressed options.

---

<div class="post-metadata">

**Author:** ![KVogler](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KVogler](https://forums.unrealengine.com/u/KVogler)\
**Post date:** [January 26, 2017, 2:00pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/27 "2017-01-26T14:00:19Z")

</div>

> [@](#):
>
> for that reason I tend to combine three Alpha channels into a new RGB texture.

However that has the drawback that you use up one more texture sampler node.  
Especially in layered materials I tend to use the alpha channel.

---

<div class="post-metadata">

**Author:** ![Luos](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/luos/32/918700_2.png) [@Luos](https://forums.unrealengine.com/u/Luos)\
**Post date:** [January 26, 2017, 2:59pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/28 "2017-01-26T14:59:18Z")

</div>

> [@KVogler;656686](#):
>
> However that has the drawback that you use up one more texture sampler node.  
> Especially in layered materials I tend to use the alpha channel.

as a vfx guy, thats the least of my worries hehe.  
but yea, from a layered material pov I can fully understand that problem.

---

<div class="post-metadata">

**Author:** ![Olander](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Olander](https://forums.unrealengine.com/u/Olander)\
**Post date:** [January 27, 2017, 4:27am UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/29 "2017-01-27T04:27:56Z")

</div>

> [@ZacD;656631](#):
>
> That’s incorrect, textures get converted to DXT or BC5 formats for games,

Sort of incorrect (there is really no difference in the Pixel Quality between TGA and PNG thank you for the correction), there are options to not do so but also BCn has compression techniques associated with them that record the texels in a texture. So in essence whether the texture is TGA, PSD, TIF, PNG, JPG or whatever the texture quality, texture size, and pixel depth are what is important. This _Does_ have a large input into what it used in VRAM…think unoptimized texture fill rates.

The argument here is TGA vs PNG in game dev…UE4 more specifically. If you have good textures then you will get good compression in the BCn with little to no artifacts. When you have a large game being designed then having TGA or PSD as your bulk of textures then space is simply being wasted for no reason. TGA still has a place but just not the bulk of the textures.

---

<div class="post-metadata">

**Author:** ![duke22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@duke22](https://forums.unrealengine.com/u/duke22)\
**Post date:** [January 27, 2017, 4:59am UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/30 "2017-01-27T04:59:54Z")

</div>

> [@;647186](#):
>
> Actually, there is a difference between PNG and TGA when it comes to reflections. TGA has better proportions when it comes to texture data for reflections. Replacing png with tga will give your materials better quality as far as reflections.

I’d really like to hear the reasoning behind this - it’s the first I’ve heard of it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c94f194d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c94f194d](https://forums.unrealengine.com/u/anonymous_user_c94f194d)\
**Post date:** [January 27, 2017, 8:54am UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/31 "2017-01-27T08:54:38Z")

</div>

> [@duke22;657007](#):
>
> I’d really like to hear the reasoning behind this - it’s the first I’ve heard of it.

Runtime does not know what format texture was before it’s converted to UASSET. Only difference is that TGA has better alpha support. So if that alpha channel is used for roughness or specular then it might affect.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c6fad2fa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c6fad2fa](https://forums.unrealengine.com/u/anonymous_user_c6fad2fa)\
**Post date:** [February 1, 2017, 9:17pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/32 "2017-02-01T21:17:42Z")

</div>

The TGA image file format does support compression.  
But whether UE4 supports the compressed TGA format I have not tested it.  
TGA compression is lossless RLE (run length encoded). So it typically doesn’t offer much compression in size unless the image has large regions of the same pixel values.  
PNG compression is lossless DEFLATE (similar to Zip). So it typically can compress complex images fairly well.  
Both image formats are not relevant to what actually ends up in-game, as the bitmap image from the graphics file is converted for use in the engine.  
There are some variations between the two image formats for support of pixel types and alpha channels.

---

<div class="post-metadata">

**Author:** ![Darthadin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Darthadin](https://forums.unrealengine.com/u/Darthadin)\
**Post date:** [February 1, 2017, 9:37pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/33 "2017-02-01T21:37:45Z")

</div>

I know that UE4 will export textures in the Targa format. So that would give me more reason to believe in using it for my textures. However, I wouldn’t make that my sole argument.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_34b4788d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_34b4788d](https://forums.unrealengine.com/u/anonymous_user_34b4788d)\
**Post date:** [June 26, 2022, 1:56pm UTC](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211/35 "2022-06-26T13:56:25Z")

</div>

As the title says, I have to convert thousands of image files , I was looking for something which can do it automatically but it must also allow me to keep “created, modified, accessed date/time” from the original file.

I know IrfanView can do this without problem but I noticed that the output file size is still a little big.

Then, I discovered PngOptimizer, I must say that it is very simple and fast and compresses more respect to IrfanView but unfortunately, PngOptimizer seems that it does not allow me to keep the original date info.

At the moment I do not know what else to look for / to do.

Do you have any suggestions? Any help is appreciated.

Thank you! =)

[Previous page](https://forums.unrealengine.com/t/tga-vs-png-for-textures/24211.md?page=1)
