News for hackers. Stuff that matters.
Re:Show HN: JavaScript image compressor by dsun176 on Tuesday July 25, 2017 @09:42AM (#14847624)
Input (original)

name: Fuckscape_d80352_5915762.jpg

type: image/jpeg

size: 19.14 KB

Output (compressed)

name: Fuckscape_d80352_5915762.jpg

type: image/jpeg

size: 20.64 KB (-7.85% off)

So your image-compressor actually adds 7.85% to the filesize? Maybe I don't understand the meaning of compression, but shouldn't it be smaller?

Re:Show HN: JavaScript image compressor by dankent on Tuesday July 25, 2017 @09:48AM (#14847662)
I got better results:

Input (original) name: the-northern-trifid-nebula-8499-1920x1200.jpg type: image/jpeg size: 737.26 KB

Output (compressed) name: the-northern-trifid-nebula-8499-1920x1200.jpg type: image/jpeg size: 263.17 KB (64.30% off)

I guess your original was more optimised than mine.

A tool like this should definitely check to make sure it has actually reduced the file size and, if not, just return the original with a note that it couldn't make any gains.

Re:Show HN: JavaScript image compressor by andreasklinger on Tuesday July 25, 2017 @09:45AM (#14847652)
you should share an image link plus your settings/script to make this useful for OP
Re:Show HN: JavaScript image compressor by phoboslab on Tuesday July 25, 2017 @10:28AM (#14847951)
The result is dependent on your Browser. This library uses the Browser's native `ctx.toDataURL('image/jpeg', quality)` method to re-encode the image. The actual compression algorithm is not implemented in JavaScript.