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

Checking if lossless png is more efficient #10

Open
fabricasapiens opened this issue Jan 17, 2012 · 2 comments
Open

Checking if lossless png is more efficient #10

fabricasapiens opened this issue Jan 17, 2012 · 2 comments
Labels

Comments

@fabricasapiens
Copy link

I know this project is to optimize lossy compression, but I guess there are many cases in which lossless compression actually yields better compression rate at superior quality. Examples could be backgrounds with gradients or images with unicolor areas.

Would it be possible to simply generate a PNG for such 'usual suspects' and see if its size is lower than the JPG?

@rflynn
Copy link
Owner

rflynn commented Jan 17, 2012

Yes, probably based on the number of colors in the image.

@kornelski
Copy link
Contributor

On OS X you can compile pngquant with Cocoa reader which gives it JPG support and then run:

pngquant --skip-if-larger input.jpg -o output.png

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

No branches or pull requests

2 participants