javascript - How to compress images to a specified volume (not a specified size) on the JS side
大家讲道理2017-05-19 10:19:18
0
1
662
Compress the image to within the specified size. For example, 500KB is not the specified size. Can 200X300 be achieved? The ones I can find online are all in designated sizes.
Can be implemented through Canvas, there is an open source project on Github: Portal
Pure front-end implementation, does not rely on the backend. However, the use of Canvas and File API has higher requirements on the browser (IE6/7/8 does not need to consider orz).
Demo address: Portal (tip: jquery uses google cdn and needs to cross the wall)
Can be implemented through Canvas, there is an open source project on Github: Portal
Pure front-end implementation, does not rely on the backend. However, the use of Canvas and File API has higher requirements on the browser (IE6/7/8 does not need to consider orz).
Demo address: Portal (tip: jquery uses google cdn and needs to cross the wall)
Screenshot:
Compression effect: