我想压缩目录中存在的所有图像文件,并使用pngquantpng
将所有这些转换/压缩的图像文件保存到具有原始图像名称的不同文件夹中:
批量压缩的语法:
pngquant.exe --quality=40-55 images\*.png
它压缩目录中的所有PNG图像文件,images
并将压缩文件保存为同一目录中的新文件,并在原始文件名后附加-fs8 ,例如
arrow.png
arrow-fs8.png
arrow.png
是源文件,arrow-fs8.png
是输出文件。
我想将所有转换后的文件及其原始名称保存在单独的文件夹中。
有谁知道如何用pngquant.exe做到这一点?
pngquant
通过使用选项运行它来帮助输出-h
:
pngquant, 2.5.2 (October 2015), by Greg Roelofs, Kornel Lesinski.
Compiled without support for color profiles. Using libpng 1.6.18.
usage: pngquant [options] [ncolors] -- pngfile [pngfile ...]
pngquant [options] [ncolors] - >stdout <stdin
options:
--force overwrite existing output files (synonym: -f)
--skip-if-larger only save converted files if they're smaller than original
--output file destination file path to use instead of --ext (synonym: -o)
--ext new.png set custom suffix/extension for output filenames
--quality min-max don't save below min, use fewer colors below max (0-100)
--speed N speed/quality trade-off. 1=slow, 3=default, 11=fast & rough
--nofs disable Floyd-Steinberg dithering
--posterize N output lower-precision color (e.g. for ARGB4444 output)
--verbose print status messages (synonym: -v)
Quantizes one or more 32-bit RGBA PNGs to 8-bit (or smaller) RGBA-palette.
The output filename is the same as the input name except that
it ends in "-fs8.png", "-or8.png" or your custom extension (unless the
input is stdin, in which case the quantized image will go to stdout).
The default behavior if the output file exists is to skip the conversion;
use --force to overwrite. See man page for full list of options.