question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CLI] Different results between CLI and Web

See original GitHub issue

I used the CLI to output a jpg using --mozjpeg and --webp, but using the same options given on the tool based on the web, the output given to me is different.

Output on the web: mozjpeg -> 92.4kb webp -> 51.6kb

Output using the CLI: mozjpeg -> 84.9kb webp -> 13.2kb

Also, CLI affects the space color of the image and gives a bad compression, resulting in a worst processed image, comparing with the tool based on the web. I used the same .jpg source for this test, and the same options (I copied the same code that offers the web, the npx command).

I used on the CLI:

webp version

squoosh-cli --webp '{"quality":75,"target_size":0,"target_PSNR":0,"method":0,"sns_strength":50,"filter_strength":60,"filter_sharpness":0,"filter_type":1,"partitions":0,"segments":4,"pass":1,"show_compressed":0,"preprocessing":0,"autofilter":0,"partition_limit":0,"alpha_compression":1,"alpha_filtering":1,"alpha_quality":100,"lossless":0,"exact":0,"image_hint":0,"emulate_jpeg_size":0,"thread_level":0,"low_memory":0,"near_lossless":100,"use_delta_palette":0,"use_sharp_yuv":0}' -d out 30.jpg

mozjpeg version

squoosh-cli --mozjpeg '{"quality":75,"baseline":false,"arithmetic":false,"progressive":true,"optimize_coding":true,"smoothing":0,"color_space":3,"quant_table":3,"trellis_multipass":false,"trellis_opt_zero":false,"trellis_opt_table":false,"trellis_loops":1,"auto_subsample":true,"chroma_subsample":2,"separate_chroma_quality":false,"chroma_quality":75}' -d out 30.jpg

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
letitzcommented, Dec 20, 2020

I get particularly bad results trying to compress an image to webp using the CLI. Online the result is fine, but offline it does not seem the encoder options are being respected. I get potato quality regardless of the options I pass to the CLI. Tried copy/pasting the CLI from the webapp too, to no avail.

3reactions
surmacommented, Jan 5, 2021

I figured out the potato quality on WebP. Seems like I bundled an old version of the WebP Wasm binary by accident. I fixed that and published @squoosh/cli@0.6.1.

I still see some minor file size difference, even when I use a PNG source file, which is very surprising to me. I’ll look at that another time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GUI vs CLI | Top 8 Most Useful Differences You Should Learn
GUI means a Graphical user interface while CLI means the command line interface. As the name suggests, one has to write commands to...
Read more >
What is a command-line interface (CLI)? - TechTarget
CLI advantages and disadvantages​​ The following are advantages of a command-line interface: granular control of an OS or application; more efficient management  ......
Read more >
What Is CLI and Why Would You Use It Over GUI? - Hostinger
CLI stands for command line interface. It is a program that allows users to type text commands instructing the computer to do specific...
Read more >
Mismatch of vulnerabilities: Why does the CLI show a different ...
The CLI has direct access to your private dependencies and build environment. In comparison to something like npm audit , Snyk reports different...
Read more >
Difference between CLI and web-based GUI - Cisco Community
Hi, I've been working with Cisco 1310 bridges and 1231 APs. So far, I have used the browser to configure the bridges. I'm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found