Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Compression Using ECT #151

Open
drsassafras opened this issue Jul 5, 2016 · 9 comments
Open

Better Compression Using ECT #151

drsassafras opened this issue Jul 5, 2016 · 9 comments

Comments

@drsassafras
Copy link

Images already compressed as far as they can be with ImageOptim, then I ran through ECT (https://github.com/fhanau/Efficient-Compression-Tool) and got the following results. (see screenshot) I have also attached the images I used for your review. These images are a selection of the ones that did achieve better compression. Only about half of the images I tried did compress smaller.

screenshot
images.zip

@kornelski
Copy link
Member

ECT uses derivatives of the tools that are already in ImageOptim:

https://github.com/fhanau/Efficient-Compression-Tool/tree/master/src

so I think it only makes a different time/compression tradeoffs.

@drsassafras
Copy link
Author

@pornel How is it then that that I was able to achieve a smaller compression size? are you able to compress the images I posted further with ImageOptim? Why was I not able to achieve the compression you are saying ImageOptim it already capable of.

I am also not sure your right about it having the same compression algorithms. It employs a "zopfli-like deflate", I'm relatively sure that ImageOptim uses the true zopfli algorithm.

Can you help me to understand where I went wrong in my benchmarks?

If it is as you say and its just a time-compression tradeoff, can you enable it in ImageOptim? ImageOptim takes a very long time to compress images on its max setting, and this compression was relatively very quick for an easy 1% compression gain.

@kornelski
Copy link
Member

ECT is not "zopfli-like", it is using the zopfli tool. Both ECT and ImageOptim use a slightly modified version of it to speed it up at cost of compressing some files less.

If you run files through ImageOptim and then ECT you will see only cases where ECT was better, but you will not see cases where ECT was worse. And running two versions of Zopfli is not quick, it's doubling the compression time.

@fhanau
Copy link

fhanau commented Jul 16, 2016

ECT is based on tools used by Imageoptim but the performance is much better, see the results on enwik8 on the front page. Zopfli(png), Optipng and zlib are heavily modified. Please test it yourself.

@kornelski
Copy link
Member

Thanks for the info @fhanau. Do you plan to contribute these improvements to official Zopfli?

@fhanau
Copy link

fhanau commented Jul 16, 2016

Yes. I 've focused on improving ECT until now, but I will eventually do that.

@fhanau
Copy link

fhanau commented Jul 20, 2016

So the zopfli devs are not really responding to my and others' performance-improving pull requests. Maybe you should just add ECT for now.
I'm confident that ECT can replace all PNG tools except PNGOUT(which sometimes achieves better compression).

@jibsen
Copy link

jibsen commented Jul 21, 2016

Give them a little time, there is a tendency that PR to google projects hang around in limbo for a while. I think it's great you are contributing your improvements back so there is a chance they can benefit others.

@MarcusJohnson91
Copy link

drsassafras The PNG format relies on Huffman coding (and optionally filtering before), ALL PNG optimizers go about optimizing the image with "bruteforcing" the huffman encoder to generate more compact code.

They do that, by simply compressing it a bunch of times with a bunch of different settings, and saving the best result.

That's why it takes so long, and why it's possible to make smaller files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants