Convert TWRP Backup into flashable rom zip
I found these instructions that explain how to take a TWRP backup and turn it into a flashable zip file. This would allow someone to create a "factory" rom pre-rooted to be flashed.
For TWRP Backup
Transfer the TWRP backup from Phone to PC.
You’ll see a file named system.ext4.win which is the System partition backup of your device. Rename it to system.ext4.tar (Changing its extension from .win to .tar)
Extract the system.ext4.tar using an archive software like Winrar or 7zip.
If your TWRP backup is not in compression mode, you will directly get the system folder, else you will get a file named system.ext4, which should be renamed again to system.ext4.tar and extract it to get the system folder.
Take the boot.emmc.win file and rename it to boot.img.
Now collect a META-INF folder from any custom ROM which is made for your device. Make sure you get the correct Meta-Inf folder, else the Zip won’t work and might worsen the condition of your device.
Select the META-INF, System folders and the boot.img and right click your mouse and select add to Archive.
In the Archive settings, choose the extension of the compressed file as Zip (Make sure of this part)
Now you can use this Zip file to flash it on your Custom recovery.