Earlier quoted context omitted.
How is it possible to have one-way only lossless compression?
Decompressing and recompressing a zip gives a lossless copy of the actual data , but there's no way to reconstruct the same exact zip you started with. The same thing can be done with image data. For something like jpeg you can keep the coefficients but store them in a more compact form. For what it's worth JPEG XL claims that it's 'reversible', but I'm not sure if that means you get your original jpeg back, byte for…
But it might be more hassle than it's worth it to create the code and algorithms to do so.