Good advice, but there are lots of lossless compression formats and your comment only applies to lossy compression (of which standard jpeg is one).

I’ve been meaning to play around with this. My Canon SLRs all run magic lantern and it has the option in exposure bracketing to write a script to get you started with enblend/enfuse But there are so many options I haven’t gotten the right combination of exposure and focus blending or tone mapping yet.