Resizing the Image through HTML5 canvas API reduces the size of image. Is this compression lossy or lossless ? , Also is it good to use that method for uploading JPG/JPEG images to server after compression (means any performance issues) ?
Asked
Active
Viewed 369 times
0
-
As long as it is on the canvas it is only raw pixels data. When you export the canvas as image you have options between lossy and losless formats, but no, it's generally not a good idea. – Kaiido May 04 '18 at 09:09
-
Possible duplicate of [Downsizing image dimensions via pure JS leads to image size inflation (in bytes)](https://stackoverflow.com/questions/48632459/downsizing-image-dimensions-via-pure-js-leads-to-image-size-inflation-in-bytes) – Kaiido May 04 '18 at 09:11
-
Not a perfect dupe but treats at least some aspects of your multi-question – Kaiido May 04 '18 at 09:11
-
@Kaiido I read above mentioned solution and it is fine, I could use that.Actually I have to implement compression for mobile web and canvas api does not seem to be fully supported by recent versions of mobile browsers (https://caniuse.com/#feat=canvas). So is there any other ways for image compression apart from using Canvas ? – Deepak Maurya May 04 '18 at 11:09