Does anyone know of any free script that compresses JPG, GIF and PNG files as much as possible?
You might be able to resize the image with
canvas and export it using dataURI. Not sure about compression, though.
Take a look at this: Resizing an image in an HTML5 canvas