Skip to content
Server-sideDeleted in 30 minutes

Convert TGA to WebP

A TGA on a web page is a file nobody can see — no browser has ever read the format. WebP is the opposite end of the same problem: built for browsers, aggressively small, and one of the few lossy formats that keeps an alpha channel. For putting renders and texture previews online, it is the right target.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free
TGAWEBP

Drop your TGA file here, or click to browse

Up to 50 MB. Deleted automatically after 30 minutes.

What it does

  • Transparency preserved, unlike JPG
  • Dramatically smaller than the TGA or a PNG
  • Encoded at quality 82, a number we publish
  • Reads uncompressed and RLE Targa alike

How to use TGA to WebP

  1. 1

    Add the TGA

    Drop it in. Both the uncompressed and run-length-encoded variants are read.

  2. 2

    Encoded as WebP

    Quality 82, with the alpha channel carried through if the file has one.

  3. 3

    Put it on the page

    Every browser released since 2020 reads WebP. Keep the TGA as the working file.

How it works

The Targa file is decoded — uncompressed or run-length-encoded, 8 to 32 bits per pixel — and re-encoded as WebP at quality 82 with any alpha channel carried through.

From the least compressed format to one of the most

The size difference here is larger than in almost any other conversion on this site, and it is worth understanding why rather than being surprised by it.

Targa stores pixels. Its only compression is run-length encoding — repeat this pixel n times — which collapses flat areas and achieves essentially nothing on a photograph, a render or a detailed texture. Many TGA files are written with no compression at all, because the format exists to be read fast rather than stored small. A 4096 by 4096 32-bit texture is 64 megabytes and that is the format working as designed.

WebP is at the other extreme: a modern lossy codec tuned for the constraint of a browser on a phone on a mobile network, with an alpha channel because web pages have backgrounds of their own.

Converting between them typically drops two orders of magnitude. Almost all of that comes from the source having no compression rather than from the target being aggressive.

Showing an asset is not shipping one

This distinction is the thing to get right, and it is easy to get wrong.

A game or 3D pipeline does not ship PNG, TGA or WebP to the GPU. It ships block-compressed textures — BC/DXT on desktop, ASTC or ETC on mobile — generated at build time from a lossless source. That compression is designed to be decoded by the hardware directly while sampling.

Feed that pipeline a WebP and you have stacked two lossy compressors with different failure modes. The artifacts do not cancel; they compound, and they become visible exactly where texture artifacts always do — after tiling, magnification and filtering, in the mid-tones of a normal map or the edges of a mask.

So: keep the TGA, or a PNG, as the source asset. Use this conversion for the portfolio page, the documentation screenshot, the client preview — the places where a person is looking at the picture rather than a renderer consuming it.

Examples

A render for a portfolio page

hero-render.tga
hero-render.webp

A sixty-megabyte render becomes a few hundred kilobytes, background still transparent so it sits on the page's own color.

A texture preview in documentation

bark-diffuse.tga
bark-diffuse.webp

For showing what a texture looks like. Not for shipping the texture — see below.

Frequently asked questions

Does the alpha channel survive?

Yes, and it is the reason to choose WebP over JPG here. WebP carries a full alpha channel even in its lossy mode, which is unusual — JPEG has none at all and must fill transparent areas with a solid color. A 32-bit TGA is nearly always 32-bit because someone needed that transparency, so losing it is losing the point of the file.

How much smaller is it?

Enormously, because the starting point is barely compressed. Targa's only compression is run-length encoding and many files use none at all, so a 4096 by 4096 32-bit texture is 64 megabytes on disk. The same image as WebP at quality 82 is typically a few hundred kilobytes. Against a PNG of the same picture, expect roughly three to five times smaller.

Can I ship game textures as WebP?

Not usually, and the reason is not the format's quality. Engines want textures in a GPU block-compressed form — BC/DXT, ASTC, ETC — which they generate at build time from a lossless source. Feeding that pipeline an already-lossy WebP compounds two different compressors and produces visible artifacts after tiling and filtering. Keep the TGA or a PNG as the source asset; use WebP to show people what it looks like.

Should I use PNG instead?

For anything that will be edited, re-rendered or used as a source asset, yes — /tga-to-png is lossless. For a web page, WebP is several times smaller at a quality difference nobody can see, and page weight is a real cost. The rule of thumb: PNG for files that are inputs to something else, WebP for files a person is going to look at in a browser.

Does my file leave my computer?

Yes. The decoding runs on our server rather than in a browser tab. Your file and the result are both deleted within 30 minutes by a timer, and nothing is stored, indexed or kept against an account.