chai2010 / guetzli-js

Guetzli for NodeJS/Browser
https://www.npmjs.com/package/guetzli-js
MIT License
29 stars 1 forks source link

why size is different? #4

Open birdlex opened 7 years ago

birdlex commented 7 years ago

I use this project compared with "google/guetzli-js"

// google/guetzli-js

$ guetzli download.jpg download_.jpg
// chai2010/guetzli-js

fs = require('fs');
guetzli = require('guetzli-js');
helper = require('guetzli-js/dist/lib/helper');

m1 = helper.loadImage('download.jpg');
jpegData = guetzli.encodeImage(m1);
fs.writeFileSync('download__.jpg', jpegData);

Archive.zip

export files size are different check attach file please

// attach file

original = download.jpg   318K
google/guetzli-js = download_.jpg   231K
chai2010/guetzli-js = download__.jpg   243K
chai2010 commented 7 years ago

on google/guetzli-1.0.1 (darwin):

$ node dist/bin/guetzli-cli download.jpg download-js.jpg 
$ ./guetzli_darwin_x86-64 --quality 95 download.jpg download-google.jpg

$ ls -l *.jpg
-rw-r--r--  1 chaishushan  staff  237005  4  8 02:51 download-google.jpg
-rw-r--r--  1 chaishushan  staff  248910  4  8 02:43 download-js.jpg
-rw-------@ 1 chaishushan  staff  325553  4  7 15:11 download.jpg

PS: guetzli-js use the same quality(95) as google/guetzli.

chai2010 commented 7 years ago

the size is different in go version:

$ go get github.com/chai2010/guetzli-go/apps/guetzli
$ guetzli -quality=95 download.jpg download-golang.jpg 
$ ls -l *.jpg
-rw-r--r--  1 chaishushan  staff  294548  4  8 03:25 download-golang.jpg
-rw-------@ 1 chaishushan  staff  325553  4  7 15:11 download.jpg