Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compress images on client side before uploading [closed]

Does anyone know of any free script that compresses JPG, GIF and PNG files as much as possible?

like image 412
xtremist Avatar asked Apr 09 '11 19:04

xtremist


People also ask

How do you compress images on the client side before uploading?

If you are looking for a library to carry out client-side image compression, you can check this out:compress. js. This will basically help you compress multiple images purely with JavaScript and convert them to base64 string. You can optionally set the maximum size in MB and also the preferred image quality.

What happens when you compress an image before sending it?

Compressing a picture maintains the height and width of the picture, but reduces the resolution. Lower resolution pictures have a smaller file size. Select the picture or pictures you need to reduce. Under Picture Tools on the Format tab, select Compress Pictures from the Adjust group.


2 Answers

I just developed a javascript library called JIC to solve that problem. It allows you to compress jpg and png on the client side 100% with javascript and no external libraries required!

You can try the demo here : http://makeitsolutions.com/labs/jic and get the sources here : https://github.com/brunobar79/J-I-C

like image 178
brunobar79 Avatar answered Sep 27 '22 21:09

brunobar79


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

like image 43
typeof Avatar answered Sep 27 '22 20:09

typeof