TGA: imagetga + imagecreatefromtga
Another straight to the point solution

Installation
Just download the zip below and unpack wherever you want it. It should work fine with any PHP version from 5 up.
License: MIT
Features
Loading TGA images:
- 8bpp grayscale
- 24bpp truecolor
- 32bpp truecolor (RGBA)
- normal and upside-down
- RLE compressed and uncompressed
- 32bpp truecolor (RGBA)
Usage examples
Loading TGA image and saving as PNG:
$im = imagecreatefromtga('image.tga');
imagepng($im, 'output.png');
Loading PNG and saving as TGA:
$im = imagecreatefrompng('image.png');
imagetga($im, 'output.tga');
Getting image's width and height without loading & parsing the whole image:
list($width, $height, $type, $bits, $type) = getimagesizetga('image.tga');
echo 'Width: ' . $width . ' Height: '. $height;
Comments