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

Looking for some clarification on the code's capabilities #71

Open
dunstan opened this issue Dec 20, 2017 · 2 comments
Open

Looking for some clarification on the code's capabilities #71

dunstan opened this issue Dec 20, 2017 · 2 comments

Comments

@dunstan
Copy link

dunstan commented Dec 20, 2017

I initially thought from the documentation that I could run jpeg-recompress against a high quality jpeg and it would produce a visually identical jpeg at a reduced file size: "Compress JPEGs by re-encoding to the smallest JPEG quality while keeping perceived visual quality the same ... This is a lossy operation, but the images are visually identical..."

However, two things confuse me and I wondered if you could clarify them for me so I can get the most out of this excellent code?

  1. Some of the images that are produced show a lot of those strange jpeg compression blocks and striated shadows. I originally found that issue using "jpeg-recompress --quality high --accurate --method smallfry --min 60 input.jpg output.jpg". I switched to SSIM and had better luck, but I'm confused as I thought the whole point was that it would always save out something that was visually identical to the input? Am I misunderstanding that? Or would this be a bug?

  2. The quality settings also confuse me. If the script is supposed to produce visually identical images at "Medium" setting, what are the High and Veryhigh settings for? And equally, does Low imply that the output will be less visually identical? I'm confused.

Thanks for any clarification you can offer me on these points, and for all the hard work you've put into this.

Original 100% quality JPEG from photoshop
orig-100
--quality medium --loops 20 --method ssim --accurate
ssim-medium

--quality high --loops 20 --method ssim --accurate
ssim-high

--quality medium --loops 20 --method smallfry --accurate
smallfry-medium

--quality high --loops 20 --method smallfry --accurate
smallfry-high

@lfos
Copy link
Collaborator

lfos commented Dec 20, 2017

Being "visually identical" is not a Boolean property. If the image is small enough (or you are far away), every pair of images becomes "visually identical". Conversely, with massive zooming and contrast, every pair of (not 100% identical) images becomes "visually distinguishable". There always is a tradeoff between space efficiency and visual quality. That is why we have the different quality options.

With high, you should be pretty much on the safe side. If you have examples where the quality when using high is quite bad and visible without zooming, please let us know.

@dunstan
Copy link
Author

dunstan commented Dec 20, 2017

Ah, okay, thank you. In that case the images I attached would serve as good examples of outcomes that are clearly different than the input. At every zoom level the striated shadows on the smallfry versions are obvious. I wouldn't expect that.

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