MineralWater
jarvis_own
There's a difference between lossy and lossless compression. The former should arguably rather be referred to as "reduction" than "compression".
The thing is, though, that traditional compression algorithms โ like ZIP, RAR, etc โ are optimized and only intended for non-media files. Highly useful, and definitely lossless (lossy would defeat the purpose!), they basically pre-date any serious "multimedia" handling within computing.
So, for media files, formats like JPEG (images) or MP3 (audio) quickly became popular. But these are obviously lossy, as pointed out.
Lossless, true, compression is possible though! For audio, FLAC is most popular and well-known. The image equivalent you're looking for is AVIF.
As with audio, there are other lossless compression algorithms available too. In fact, both JPEG and PNG can do lossless as well, but AVIF is probably most popular.
Comparing lossless compression is a thankful task, as you only need to factor in speed and efficiency. No difference in quality โ it's lossless! Were there any differences in output quality, the format isn't lossless by definition...
So, to the main question on how to go about compressing photos losslessly on Android: I'd recommend https://squoosh.app/ as it's usable within browser, or as a PWA.
Not a cloud service, as all processing is done client-side. But, keep in mind that it still does lossy compression as default. You need to manually select AVIF as output, and hit the "lossless" checkbox. Setting can be saved as preset for future use, though.
It takes quite some time to process photos on-device, and lossless compression yields "only" about a 25-30% reduction in size, compared to 50-75% for lossy. But Squoosh is probably your best option!