Rule #4 save files in Jpeg format or... in Jpeg format!Next Rule
I will save you money
I once thought I was clever because my applications could upload and process image files in any one of 40 different formats. I now know I was dumb because YAGNI (you ain't gonna need it)
Why just Jpeg?
Even in the most demanding environments selling digital content it's rare to use any other format. Take the photo library I worked with. Never once in 20 years have I been asked for a RAW file. Few photo libraries deliver multitudinous obscure lossless formats - not when they can deliver a Jpeg.
OK, Jpeg is lossy (discards information) but, if used intelligently no one will notice. As long as you use maximum quality setting I defy anyone to tell me which is the jpeg and which is the original on a blind, side-by-side test. The minimal loss of quality is far outweighed by the savings in file sizes. A jpeg can still be up to a twentieth of the original file size even when saved at max quality setting!
Rule #4a is that there is always another file format coming down the road that is the next great thing. Jpeg V Raw V Avif V any other format is an anal technical argument that is only of interest to photographers! Jpeg has stood the test of time.
Just thinking out loud... Off the top of my head I see very few scenarios where you must have the closest copy of the file that was shot. Perhaps if you were writing an app for CSI and needed to preserve the chain of evidence from the camera that photographed a crime scene. That camera is probably set by default to capture jpeg anyway!
Ah but, my toolkit allows you to store the original file anyway if you really want to. So you can to satisfy the .001% of customers who might want the original.
If we run with the CSI scenario, how could you be forensically sure of the provenance for an image? One word. Metadata.