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

How to get sample value for existing image for compression #394

Open
shailenderjain opened this issue Mar 7, 2021 · 4 comments
Open

How to get sample value for existing image for compression #394

shailenderjain opened this issue Mar 7, 2021 · 4 comments

Comments

@shailenderjain
Copy link

Hello, While trying to use cjpeg for compression, i want to pass the sample value. The sample value should be equal to image which needs to be compressed. Is there any mechanism by which i can get the sample value for the image

@zvezdochiot
Copy link

zvezdochiot commented Mar 7, 2021

Hi @shailenderjain .

Jpegoptim ( https://github.com/tjko/jpegoptim ) with mozjpeg's libjpeg library will solve your "problem".

@kornelski
Copy link
Member

What do you mean by sample? cjpeg takes -sample arg.

@shailenderjain
Copy link
Author

I want to ensure if the files which i want to compress via mozjpeg should use the right sample plan. For e.g. if my image is using 1*1 then the same should be used by mozjpeg. It looks like if there is no parameter for mozjpeg then it could uses some DEFAULT parameter

@kornelski
Copy link
Member

I see. This indeed isn't exposed in the demo command-line tool, and you'd need another libjpeg-based tool to choose correct subsampling for you.

I know https://github.com/imazen/imageflow is smart about it.

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

3 participants