FWIW, you can do this with a few lines of JS in the browser using canvas.drawImage() from an img element followed by canvas.toBlob().
Firefox now adds random noise to all canvas readback operations (getImageData, toDataURL, and toBlob).
That would require a browser that supports WebP
Firefox now adds random noise to all canvas readback operations (getImageData, toDataURL, and toBlob).