Note: this is incomplete and merely an exercise. I took the idea and most of the code from http://odetocode.com/blogs/scott/archive/2013/07/03/building-a-filereader ...
Simple image compressor that accept image source from Javascript FileReader and use canvas as compressor.