Encode JPEG or WebP under a file size limit.
Open-source tools that run in your browser.
Bean Yourself