TGA to TIFF API
POST a TGA to /v2/convert/tga/to/tiff and get an uncompressed single-page TIFF. Color TGAs give RGB or RGBA, grayscale gives 8-bit gray (RGBA if it has alpha), and ImageResolution writes a real DPI.
- Endpoint
- POST /v2/
convert/ tga/ to/ tiff - Accepts
- tga
- Sample timing
- under 1 ms median of 5 runsHow we measure
- Request size
- Up to 10 MB on the Free plan or 100 MB on paid plans, all files together
Request and response
Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.
curl -sS -X POST \
https://api.pdfconversionapi.com/v2/convert/tga/to/tiff \
-H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
-F File=@shield-icon.tga \
--form-string ImageResolution=300 \
-o response.json
# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
mkdir -p converted
name=$(jq -r '.Files[0].FileName' response.json)
jq -r '.Files[0].FileData' response.json \
| base64 --decode > "converted/$name"
else
cat response.json
fiimport base64
import os
import requests
key = os.environ["PDFCONVERSIONAPI_KEY"]
response = requests.post(
"https://api.pdfconversionapi.com/v2/convert/tga/to/tiff",
headers={"Authorization": f"Bearer {key}"},
files=[("File", open("shield-icon.tga", "rb"))],
data={
"ImageResolution": "300",
},
timeout=180,
)
result = response.json()
if not response.ok:
raise SystemExit(f"{result['Code']}: {result['Message']}")
os.makedirs("converted", exist_ok=True)
for file in result["Files"]:
path = os.path.join("converted", file["FileName"])
with open(path, "wb") as out:
out.write(base64.b64decode(file["FileData"]))
print(path, file["FileSize"], "bytes")
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { join } from "node:path";
const form = new FormData();
const file = "shield-icon.tga";
form.append("File", new Blob([await readFile(file)]), file);
form.append("ImageResolution", "300");
const url = "https://api.pdfconversionapi.com/v2/convert/tga/to/tiff";
const key = process.env.PDFCONVERSIONAPI_KEY;
const response = await fetch(url, {
method: "POST",
headers: { Authorization: `Bearer ${key}` },
body: form,
});
const result = await response.json();
if (!response.ok) {
throw new Error(`${result.Code}: ${result.Message}`);
}
await mkdir("converted", { recursive: true });
for (const file of result.Files) {
const path = join("converted", file.FileName);
await writeFile(path, Buffer.from(file.FileData, "base64"));
console.log(path, file.FileSize, "bytes");
}
{
"ConversionCost": 1,
"ConversionTime": 0,
"Files": [
{
"FileName": "shield-icon.tiff",
"FileExt": "tiff",
"FileSize": 262358,
"FileData": "SUkqACgABAAsAQAAAQAAACwB…"
}
]
}Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.
The sample, converted
The same file the code sends. Download the input and the output and compare them yourself.

- Input
- shield-icon.tga (16 KB)
- Output
- shield-icon.tiff (256 KB)
- Source
- A 256 x 256 pixel-art shield icon with a transparent background and a half-transparent shadow, drawn by us and saved as a 32-bit run-length-encoded TGA. (CC0-1.0). How it was made
- Made by
- 2026-11-04, API build
9eeeb0640aba
Parameters
Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.
| Parameter | What it does |
|---|---|
ImageResolutioninteger | Fills XResolution and YResolution with this value and sets the unit to inches; the sample is tagged 300 dpi. Without it the tags read 1/1 with no unit.Values: 10–800 |
ImageWidthinteger | Resample to this width before writing. The TIFF is uncompressed, so its size follows the pixel count.Values: 1–20000 |
ImageHeightinteger | Resample to this height, or fit inside a width × height box.Values: 1–20000 |
ScaleProportionsboolean, default true | false fills the exact box, changing the aspect ratio. |
ScaleIfLargerboolean, default false | true stops small textures from being enlarged. |
ScaleImageboolean, default true | false crops rather than resamples. |
ColorSpaceenum, default default | gray gives an 8-bit grayscale TIFF for opaque TGAs (65,734 bytes from a 24-bit copy of the shield). On a TGA with transparent pixels, gray and monochrome keep the alpha and write RGBA with equal gray channels: 262,358 bytes for the shield.Values: default, rgb, gray, monochrome; cmyk returns 400 |
TransparentColorstring | Sets alpha to 0 for pixels of exactly this color, producing an RGBA TIFF.Values: #RRGGBB, R,G,B or a basic color name |
FileNamestring | Name for the .tiff file. |
StoreFileboolean, default false | Store the TIFF for 3 hours and return a URL. |
What carries over, and what doesn't
Kept
- Every pixel and alpha value of the sample (8 bits per sample, 4 samples per pixel)
- Grayscale as grayscale: a gray TGA became an 8-bit, one-channel TIFF
- A DPI you can rely on: the sample's tags read 300 × 300 pixels per inch
Lost or not yet supported
- Compression. The TIFF is written uncompressed: 262,358 bytes for the 16,376-byte sample.
- A label on the alpha channel. The fourth sample has no ExtraSamples tag; two readers we tried still treated it as transparency, but a strict TIFF reader warned about the channel count.
- A gray-plus-alpha layout. A grayscale TGA with alpha, or
ColorSpace=grayon a transparent one, is written as RGBA with the gray value in each color sample: 262,358 bytes at 256 × 256, twice the pixel bytes that gray plus alpha would need. - The TGA image ID and footer.
Limits
- One TGA per request, one page out.
- 100,000,000 pixels per image, checked before decoding.
- Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
- 120 seconds per conversion, then 504.
Where teams use it
Print and layout from game or render art
Print shops and layout tools work with TIFF at a stated DPI. Convert a TGA render or texture and set ImageResolution so the page knows its print size.
Archiving textures in a common format
If your archive standardizes on TIFF, the uncompressed output keeps the exact pixels and alpha of each TGA, with no compression scheme a future reader must support.
Questions
Can I get a compressed TIFF?
Not from this route today: the strip is stored without compression, and no parameter changes that. If size matters, convert to PNG, which is lossless and much smaller (4,030 bytes for the sample).
What happens to a grayscale TGA with transparency?
It converts, as RGBA. There is no gray-plus-alpha mode on this route, so red, green and blue all carry the gray value: our 256 × 256 gray-plus-alpha test TGA came back as a 262,358-byte TIFF with its alpha intact. A grayscale TGA without alpha still gives an 8-bit, one-channel TIFF.
Will layout programs see 300 dpi?
Yes. ImageResolution=300 writes 300/1 in both resolution tags and sets the unit to inches, which is what layout and print tools read. The sample on this page carries exactly that.
Convert your first TGA file in a minute.