PNG to TGA Converter

Add a PNG and get a Targa file with the same pixels, see-through parts and all, for tools that ask for TGA.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

How it works
  1. The PNG is unpacked in your browser
  2. Each pixel is written out, row by row
  3. The .tga is ready to save

What it does

24-bit drops the clear parts

TGA pixels can be set to 24-bit RGB, which saves a quarter of the bytes by leaving out how see-through each pixel is. Clear and soft-edged pixels are then blended onto black, so keep 32-bit for a cutout.

Limits A side can be at most 65,535 pixels; TGA has no room to record more.

Can a TGA ever be as small as your PNG?

Not in any of our tests. Our star's pixels came through unchanged, but TGA stores them one by one with almost no packing, and even its packing setting only shortens repeats.

Why does the TGA come out so large?

If a texture tool or an older graphics program has asked you for a TGA, the first surprise is the file size. Our star icon was a 13.3 KB PNG and became a 262.2 KB TGA, about 20 times as much.

Nothing went wrong. By default the TGA lists the pixels one after another, row by row, four bytes each, behind an 18-byte header, with no packing at all. That makes its size plain multiplication: 256 × 256 pixels × 4 bytes + 18 is exactly the star's 262,162 bytes. What the picture shows makes no difference; a blank square of that size weighs the same. In return nothing is lost: read back, every one of the star's 65,536 pixels matched the PNG, its soft see-through rim included.

Does switching on RLE bring it down to PNG size?

It brings it down, but not that far. RLE, short for run-length encoding, is the only packing TGA has. Where the same pixel repeats along a row, it writes the pixel once with a count, the way a knitting pattern says "twelve purple" instead of listing twelve stitches. A broad flat area turns into a few long runs. A photo, where neighbouring pixels almost never match exactly, gives it very little to shorten.

RLE shrank both TGAs, but neither got as small as its PNG

Earth cutout

PNG 108.2 KB
TGA 200.7 KB
TGA, RLE 155.3 KB

Photo

PNG 96.2 KB
TGA 221.2 KB
TGA, RLE 203.8 KB

File size, KB

Each group is one PNG and the two TGAs this tool made from it, with the default settings and with RLE, both 32-bit. How we measured

On the Earth cutout, whose see-through background is row after row of identical clear pixels, this tool's RLE took 23% off the plain TGA. On the photo it took 8%. Both packed TGAs stayed heavier than the PNG holding the same pixels, because PNG's packing does much more than count repeats. So switch RLE on when the program you're feeding reads it and the picture has flat colour. RLE loses nothing, so the picture is the same either way.

Saving the TGA with RLE packing

  1. Tap or click Choose images and open the PNG.

  2. A narrow screen keeps the settings behind the TGA gear; tap it to open them.

  3. Change TGA storage from Uncompressed to RLE.

  4. Press Convert 1 to TGA.

  5. Press Download to keep the .tga.

When the program wants a texture file instead

Some programs would rather have a texture file, made for the graphics card, than a plain picture.

The program lists DDS among the files it takes.

FluffyBench's PNG to DDS converter

A DDS of the star came out at about a third of its TGA, but its packing nudged nearly every pixel, while the TGA's all matched the PNG.

Search FluffyBench