[CLI] Different results between CLI and Web
See original GitHub issueI 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:
- Created 3 years ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.