I think a terminal application that understands this for many different formats and easily allows you to add more formats would be very helpful
$ xxd /bin/ls | vi - /to open file : xxd -r /to save files
for gzip files, extract those, that is the best representation of what’s inside IMO, then look at those binary individually. Good luck!
Here is a sort of "curated list" of related tools:
https://github.com/dloss/binary-parsing
The most complete/populated I know of is Kaitai:
that you can use with Hiew with Kiewtai
https://github.com/taviso/kiewtai
If the question is slightly different, i.e. which bytes are used to identify a given file format, there is Trid:
https://mark0.net/soft-trid-e.html
Which has also a database of known headers/patterns.
It also has fuzzy finding features of known file format headers, so it can also be used to recover things from dd images, though it can be laggy sometimes when walking through a couple GBs of data.
I recently had some issues with objdump generated files and would love to have an utility which would make it easy to understand where the different sections from an elf file are in the binary (.bin file used for embedded system). I guess that I should write a script for this if it's not already present.