What is PGM?
PGM is the greyscale member of the Netpbm family: a three-line header, then one brightness value per pixel with no compression. It is what image-processing courses, OCR pipelines and computer-vision tools pass around when they want a format with no decoder in the way.
What is TGA?
Truevision TGA is a fixture of game development and 3D texturing, where its straightforward layout and real alpha channel have kept it in use long after browsers stopped caring about it. Files may be raw or run-length encoded.