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

Optimized images are too big #105

Closed
confile opened this issue Sep 4, 2015 · 2 comments
Closed

Optimized images are too big #105

confile opened this issue Sep 4, 2015 · 2 comments

Comments

@confile
Copy link

confile commented Sep 4, 2015

I tried a lot of jpg image to optimize with image_optim.

It reduces the size but when I compare how the results of what facebook does are, these images are way smaller than what comes out from image_optim.

Is there a way to decrease the image size any further without reducing the quality?

@toy
Copy link
Owner

toy commented Sep 5, 2015

By default image_optim is lossless, so using all the tools it will only remove all unnecessary data and will try to optimise compression. But you can allow lossy optimisations using allow_lossy: true / --allow-lossy, and if not enough with default options, configure workers to reduce image size more like jpegrecompress: {quality: 0} / --jpegrecompress-quality=0.

As a small test I've uploaded a 2048×1536 941KB image to facebook and got same size 324KB image, using image_optim --allow-lossy --jpegrecompress-quality=0 I've got a 220KB image.
Visual difference in my case was hardly noticeable.
Comparing original vs optimised using imagemagick: mean error per pixel (normalized mean error, normalized peak error)
for facebook optimisation: 5.29145e+09 (0.000184438, 0.203922)
for image_optim: 5.96241e+09 (0.000240838, 0.262745)

The jpegrecompress worker will soon get more options like #103, so more flexibility to get the desired result.

@confile
Copy link
Author

confile commented Sep 6, 2015

That is great thank you.

@confile confile closed this as completed Sep 6, 2015
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

2 participants