### ImageMagick version

all, latest git too

### Operating system

Other (enter below)

### Operating system, version and so on

all

### Description

If you try to save an indexed tga file, the alpha channel is lost.

I looked at coders/tga.c, and no wonder, it's not implemented at all. Here's a patch that fixes it:
```
$ diff -u old_tga.c tga.c 
--- old_tga.c	2023-09-07 16:38:17.000000000 +0200
+++ tga.c	2023-09-08 03:32:12.396125267 +0200
@@ -923,6 +923,9 @@
         if (image_info->depth == 5)
           tga_info.colormap_size=16;
         else
+        if (image->alpha_trait & BlendPixelTrait)
+          tga_info.colormap_size=32;
+        else
           tga_info.colormap_size=24;
       }
   if ((image->orientation == BottomRightOrientation) ||
@@ -984,6 +987,8 @@
             *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].blue));
             *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].green));
             *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].red));
+            if(tga_info.colormap_size == 32)
+              *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].alpha));
           }
       }
       (void) WriteBlob(image,(size_t) ((tga_info.colormap_size/8)*
```
On the read side, indexed tga images with alpha channel are handled properly.

Unrelated, but please consider removing that annoying "optional footer", it's no use. It was added just yesterday, wasn't there before and it worked fine.

### Steps to Reproduce

convert any_rgba.png -colors 256 -compress RLE noalpha.tga


### Images

_No response_
No alpha channel saved in Targa (tga) images (fix included)
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : No alpha channel saved in Targa (tga) images (fix included)
Issue date:

--- start body ---
### ImageMagick version

all, latest git too

### Operating system

Other (enter below)

### Operating system, version and so on

all

### Description

If you try to save an indexed tga file, the alpha channel is lost.

I looked at coders/tga.c, and no wonder, it's not implemented at all. Here's a patch that fixes it:
```
$ diff -u old_tga.c tga.c 
--- old_tga.c	2023-09-07 16:38:17.000000000 +0200
+++ tga.c	2023-09-08 03:32:12.396125267 +0200
@@ -923,6 +923,9 @@
         if (image_info->depth == 5)
           tga_info.colormap_size=16;
         else
+        if (image->alpha_trait & BlendPixelTrait)
+          tga_info.colormap_size=32;
+        else
           tga_info.colormap_size=24;
       }
   if ((image->orientation == BottomRightOrientation) ||
@@ -984,6 +987,8 @@
             *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].blue));
             *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].green));
             *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].red));
+            if(tga_info.colormap_size == 32)
+              *q++=ScaleQuantumToChar(ClampToQuantum(image->colormap[i].alpha));
           }
       }
       (void) WriteBlob(image,(size_t) ((tga_info.colormap_size/8)*
```
On the read side, indexed tga images with alpha channel are handled properly.

Unrelated, but please consider removing that annoying "optional footer", it's no use. It was added just yesterday, wasn't there before and it worked fine.

### Steps to Reproduce

convert any_rgba.png -colors 256 -compress RLE noalpha.tga


### Images

_No response_
--- end body ---
