3 ms·
So I downloaded libwebp-0.1.3-windows-x86.zip, there is cwebp.exe inside. I can't figure out how to compress PNGs losslessly into WebP. These are the options
by rorrr 15y ago
So I downloaded libwebp-0.1.3-windows-x86.zip, there is cwebp.exe inside.
I can't figure out how to compress PNGs losslessly into WebP.
These are the options it gives:
Usage:
cwebp [-preset <...>] [options] in_file [-o out_file]
If input size (-s) for an image is not specified, it is assumed to be a PNG or JPEG file.
Windows builds can take as input any of the files handled by WIC
options:
-h / -help ............ short help
-H / -longhelp ........ long help
-q <float> ............. quality factor (0:small..100:big)
-preset <string> ....... Preset setting, one of:
default, photo, picture,
drawing, icon, text
-preset must come first, as it overwrites other parameters.
-m <int> ............... compression method (0=fast, 6=slowest)
-segments <int> ........ number of segments to use (1..4)
-size <int> ............ Target size (in bytes)
-psnr <float> .......... Target PSNR (in dB. typically: 42)
-s <int> <int> ......... Input size (width x height) for YUV
-sns <int> ............. Spatial Noise Shaping (0:off, 100:max)
-f <int> ............... filter strength (0=off..100)
-sharpness <int> ....... filter sharpness (0:most .. 7:least sharp)
-strong ................ use strong filter instead of simple.
-partition_limit <int> . limit quality to fit the 512k limit on
the first partition (0=no degradation ... 100=full)
-pass <int> ............ analysis pass number (1..10)
-crop <x> <y> <w> <h> .. crop picture with the given rectangle
-resize <w> <h> ........ resize picture (after any cropping)
-map <int> ............. print map of extra info.
-d <file.pgm> .......... dump the compressed output (PGM file).
-short ................. condense printed message
-quiet ................. don't print anything.
-version ............... print version number and exit.
-noasm ................. disable all assembly optimizations.
-v ..................... verbose, e.g. print encoding/decoding times
Experimental Options:
-af .................... auto-adjust filter strength.
-pre <int> ............. pre-processing filter
- wmf 15y agoDid you try -q 100? That might be an idiom for lossless.
- rorrr 15y agoI did, and it produced a huge .webp file, 6.7 times larger than the original PNG.
- salmanapk 15y agortfm? Check the examples at the bottom: https://developers.google.com/speed/webp/docs/cwebp https://developers.google.com/speed/webp/docs/cwebp
- rorrr 15y agoDid you read that link yourself? The word "lossless" isn't even on that page. I tried setting the highest quality, but that just produces huge files.
- ZeroGravitas 15y agoYou want the webp-experimental downloads from here (the one's updated 4 days ago with the new lossless encoder): http://code.google.com/p/webp/downloads/list http://code.google.com/p/webp/downloads/list I think png2webpll.exe is the one you want (webpll = webp lossless).