Automate bit-packing multiple bakes for game engine textures

I’ve written myself a script to automate the baking process, and I’ve got it working to spit out base colour, normal, AO, metallic and roughness textures with a single click. yay!

but ideally I’d like to have it combine the ao, metallic and roughness into a single texture since they don’t require more than one colour channel each. I’m sure I could automate it in a photoshop action or something, but I figure it’d be really nice if I could roll it all into my one-click solution.

I couldn’t seem to see any simple python commands for remapping channels, so the options I’m considering are to have the script pipe ao, metal, roughness data into rgb channels at the material level, or to set up some sort of compositing nodes to combine the textures after the bake.

just curious if anyone has thoughts on what is the smartest approach for this type of problem?