shyykoserhiy / canvas-png-compression Goto Github PK
View Code? Open in Web Editor NEWShim for HTMLCanvasElement.toDataURL() to include compression for png image format.
License: MIT License
Shim for HTMLCanvasElement.toDataURL() to include compression for png image format.
License: MIT License
var url = this.canvas.toDataURL();
here is my code , it said replace the toDataURL , so how do i pass in the this canvas ?
this.canvas.CanvasPngCompression.replaceToDataURL();
CanvasPngCompression.replaceToDataURL(this.canvas);
both tested is not working, can i ask how to mke it work ? thank
I replaced the demo with a <700 KB PNG image, and the best canvas-png-compression can do is to "compress" it to 1.3 MB! By not using canvas-png-compression
I get 900 KB.
With canvas-png-compression Weight : 1341kb
With canvas-png-compression Time taken : 1000 ms
Without canvas-png-compression Weight : 859kb
Without canvas-png-compression Time taken : 230 ms
Am I doing something incorrectly?
This is the sample image: https://failiem.lv/u/ck6xnu4u
When I tried to compress the image using iOs 9 it throws the following error:
TypeError: r.slice is not a function. (In ‘r.slice(4, r.length - 4)‘, ‘r.slice’ is undefined)
It worked fine for iOs 10 and 11.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.