Skip to content
Server-sideDeleted in 30 minutes

Convert TGA to PNG

Targa is a 1984 format that refuses to die, because it does one thing very well: store pixels and an alpha channel with almost no cleverness in between. Game engines, 3D renderers and texture pipelines still write it. Almost nothing else opens it. PNG does the same job and is read by everything.

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

Add to Chrome — free
TGAPNG

Drop your TGA file here, or click to browse

Up to 50 MB. Deleted automatically after 30 minutes.

What it does

  • Lossless — nothing is discarded in the encode
  • Alpha channel preserved
  • Far smaller than the TGA, at identical pixels
  • Nothing to install

How to use TGA to PNG

  1. 1

    Add the TGA

    Drop it in. Both the uncompressed and RLE-compressed variants are read; they are the same format with different packing.

  2. 2

    Encoded as PNG

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

  3. 3

    Download it

    Usually a fraction of the size of the TGA, with identical pixels.

How it works

The Targa file is decoded — uncompressed or run-length-encoded, 8 to 32 bits per pixel — and the resulting pixels are written into a PNG. PNG is lossless, so the image in the output is the image in the input.

A format that survived by being simple

Targa was designed in 1984 for the TrueVision graphics cards that gave it its name, and it has outlived nearly all of its contemporaries for one reason: there is almost nothing to it.

A TGA is an 18-byte header and then the pixels, in the order the hardware wanted them. The only compression available is run-length encoding — repeat this pixel n times — and a great many TGA files use none at all. There is no color management to negotiate, no chunk structure to parse, no compression library to link against.

That makes it useless for distribution and excellent for pipelines. A game build loading ten thousand textures reads TGA at essentially the speed of the disk. An offline renderer writing frames does not want to spend CPU on compression it will throw away. So the format persists in exactly those places: game engines, texture pipelines, 3D rendering, some video compositing.

What it does not persist in is anything a normal person uses, which is why the file will not open.

Why PNG rather than JPG

Two reasons, and both matter more for TGA sources than for most.

The alpha channel. A 32-bit TGA exists because someone needed transparency — masking a decal, a leaf, a UI element, a render against no background. PNG carries that; JPEG has nowhere to put it and must fill it with a solid color.

Losslessness. TGA is uncompressed or nearly so, which means the file you have is exact. Converting it to JPEG introduces the first loss the image has ever had, and if it is a texture that will be sampled and filtered by a renderer, compression artifacts become visible in ways they never are in a photograph.

Use /tga-to-jpg only when something downstream insists on JPEG.

The upside-down file

One quirk worth knowing about, because it looks like a conversion bug and is not.

A TGA header carries an origin flag saying whether the rows are stored bottom-up or top-down. Bottom-up was the original convention, matching how the TrueVision hardware scanned; top-down became normal later. Both are legal, and the flag says which one this file uses.

Some writers set it wrong. Old renderers, hand-rolled exporters and a few game tools write top-down rows while marking the file bottom-up, or the reverse. A correct decoder — which is what runs here — believes the flag, so the image comes out vertically mirrored.

If that happens, the file is wrong rather than the conversion, and the fix is a vertical flip after converting. It is worth checking against however you were viewing the TGA before: some engine-specific viewers ignore the flag entirely and show every file the same way up, which hides the problem until the moment you convert.

Examples

A texture from a game asset pack

diffuse.tga
diffuse.png

Engines write TGA; art tools and web pipelines want PNG. The pixels are the same on both sides.

A render with a transparent background

render.tga
render.png

The alpha channel that made the background transparent carries straight through into the PNG.

Frequently asked questions

Why is the PNG so much smaller?

Because TGA barely compresses. Its only option is run-length encoding, which collapses runs of identical pixels and does nothing at all for a photograph or a detailed texture — plenty of TGA files are stored with no compression whatsoever. PNG applies a prediction filter and then Deflate, which is far more effective. The pixels are identical; the packing is not.

Is the alpha channel kept?

Yes, and it is the main reason to choose PNG here. A 32-bit TGA carries eight bits of alpha alongside the color, and PNG carries the same. That matters because alpha is usually the whole point of a TGA in a game pipeline — it is masking a decal, a leaf, a piece of foliage or a UI element. /tga-to-jpg cannot keep it and fills it with white.

Why do game engines still use TGA?

Because it is trivial to read and write. A TGA is a short header followed by pixels, in the order a graphics card wants them, optionally run-length-encoded. A tool that needs to load ten thousand textures at build time can parse it with almost no code and no decompression cost. The format's stupidity is its feature.

What about 16-bit and color-mapped TGAs?

Both exist and both are read. The format allows 8-bit color-mapped, 15/16-bit high color, 24-bit true color and 32-bit with alpha, plus a bottom-up or top-down row order that some old writers set incorrectly. If an image comes out vertically flipped, that flag in the original is why — it is a defect in the file rather than in the conversion.

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 — there is no account to keep it against.