How do I combine multiple .png files into a .tga file?

You can combine three grayscale ones (or four is you want to waste space and use alpha), but expecting to combine 5 .png’s into one .TGA is not a thing.
Also, you can just import the .TGA.

I got a texture from FreePBR and it gave me 5 .png files. How do I combine them into a .tga files for import into UE4?

This is what I have:

Merge Metal, AO, and Roughness like this:

make sure to disable SRGB when you import the merged texture.

Import Albedo and Normal as-is.


Go into GIMP. Grab your Diffuse (or base color). Go into the layer tab and select mask. Make it black (full transparency). Then put your height map into a different gimp file (just right mouse click your file, then elect open with GIMP and it should open in a new window). Then select your entire Height map image. Copy it, and then past it into your Diffuse File. Your Diffuse file will then have transparency where your height map was. If you export this as a TGA, your color channels will remain the same, but your alpha channel will have your height map. Do the same with your normal and roughness maps.

This is a really bad suggestion.
Alpha channels take up as much space as RG and B combined.
(RGB get compressed together, and Alpha gets compressed solo)

so combining the roughness, AO, and metal together into RGB costs as much as adding one additional texture to the alpha channel of the Albedo.

Also, due to how normal maps are generally saved (BC5) you cannot add an additional texture to the alpha channel as the Red channel gets saved in the RGB slots combined, and the Green channel gets saved in the Alpha channel.
Unless you save as DXT which results in normal maps having much more compression artifacts, and not to mention you are wasting more space due to adding an additional alpha channel to your normal map.