GD is bundled with PHP. Since PHP 7.4 imagecreatefromtga reads 24 and 32-bit true-color TGA files, raw or RLE. GD can’t write TGA.
Imagick is the ImageMagick extension: it reads every TGA variant and writes raw or RLE TGA. Use it when you need to create TGA files or open palette and grayscale ones.
GDGD is the image extension bundled with PHP. How to read TGA (Targa) files with imagecreatefromtga, convert TGA to PNG or JPEG, and which variants work.
ImagickImagick is the ImageMagick extension for PHP. How to read and write TGA files, convert TGA to PNG and back, write RLE TGA and get the size without decoding.