How To Build A Fastboot Rom?

Jan 17, 2016
I am interested in the process of creating a ROM to "flashing". Does exist any tutorial or link where I can find some information?
I know a few things: Roms for "recovery" come with the extension ".zip" and "fastboot" Roms usually come in "tgz" format, but this is not important because the content are different. In the first case, all necessary files are included and the second one, only include image files , type "img".
I understand that these files are disk images, similar to the "iso" files to burn CD's and DVD's so it's quite possible you have to first install the ROM on a device and taking images from there.
The truth is I have no idea, are just speculation but I am very curious and if you could turn a ROM for recovery on another to flash in one step, it would be great
Thanks in advance