There are detailed scenarios for the js front end image compression
An excerpt is as follows, and it should be what you want.
The difficulty of this scenario is image compression, why is the picture compression? first, because the current user is basically, a figure 1 is. Second, the user 's network status isn't great, although user 3g is very common, 4 g size, wifi hot spot, but the upload of a large number of. Again, users may not be willing to wait so long. Where's the solution? the answer is the front end compression, where the author commonly used, is LRZ download address as follows