问题标签 [pngquant]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - pngquant 和 shell_exec 检查状态码然后保存图像
我有以下代码似乎正在生成损坏的图像。Photoshop 显示“PNG 文件因 ASCII 转换而损坏”
gatsby - gatsby new 因 pngquant 相关错误而失败
[已解决]
当我尝试创建一个新的 gatsby 站点(使用gatsby new
或启动器)或尝试使用 yarn 为现有站点安装依赖项时,我总是收到以下错误:
我已经libpng
安装在我的系统(macos)上。我该如何解决我的问题?
gatsby - 使用 FreeBSD v11.3 服务器时如何选择正确的 gatsby-plugin-sharp 版本?
我正在尝试在 FreeBSD v11.3 服务器上安装和构建 Gatsby 应用程序。我的 gatsby 应用程序使用 gatsby-plugin-sharp 和 gatsby-transformer-sharp,我认为这些插件会导致错误。
这是我在 npm install 期间遇到的第一个错误:
所以我安装了旧版本的 gatsby-plugin-sharp 和 gatsby-transformer-sharp 来匹配系统上安装的 libvips (sharp v0.22.1)。在该错误消失后,但在 gatsby 构建期间出现了下一个错误:
我应该怎么做才能让它工作?我需要使用哪些版本?
javascript - Resolve: "Unknown system error -86" error when installing imagemin-pngquant/imagemin-optipng on Apple Silicon (M1)
Here's the error:
Note: This is a purely native execution (no Rosetta translation).
Looks like there's an issue whenever a package needs to build a component in C.
Update 1.
I have created issues with the following repositories:
webpack - 在 image-minimizer-webpack-plugin (mozjpeg, pngquant) 中使用有损模块时出错
我这个配置错了吗?我的期望image-minimizer-webpack-plugin
是作为一个步骤,编译整个项目模块不正确吗?
此配置会导致所有测试的图像资产文件出现以下错误。图像文件仍然被压缩和发射;但是我不希望出现错误。
ERROR in Conflict: Multiple assets emit different content to the same filename ./imgs/[...]
上述这种无损配置不会导致此类错误。
npm - php artisan nova:tool 时 pngquant 出错
我正在使用 Laravel Nova。所以,今天我遇到了一个错误。
运行此命令后php artisan nova:tool vendor/name
。
我得到一个提示:
Would you like to install the tool's NPM dependencies? (yes/no) [yes]
。
在“是”之后,npm 开始工作,但pngquant出现错误:
此外,安装了libpng-dev 。
windows - 如何使用 pngquant 批量处理包含 PNG 文件的文件夹结构并将它们输出到另一个目录中的类似文件夹结构
我正在尝试使用具有以下结构的 pngquant 处理文件夹目录:
C:\ ├───FOLDER │ ├───0 │ │ └───0 │ ├───1 │ │ └───0 │ └───2 │ ├───113 │ ├───114 │ ├───120 │ └───121
我正在使用 pngquant 来降低C:\folder\1\0\*.png
. 我这样做 *.png 因为每个文件夹可能包含 300 多个小 PNG 文件,但我需要遍历所有文件夹并使用压缩的 PNG 在另一个位置复制确切的文件夹结构。
在 Windows 中,我有一个 shell 脚本
但这只会覆盖目录中的所有文件。
这是pngquant的帮助手册。
pngquant, 2.0.0 (March 2013), by Greg Roelofs, Kornel Lesinski. Compiled with libpng 1.5.14; using libpng 1.5.14. usage: pngquant [options] [ncolors] [pngfile [pngfile ...]] options: --force overwrite existing output files (synonym: -f) --nofs disable Floyd-Steinberg dithering --ext new.png set custom suffix/extension for output filename --speed N speed/quality trade-off. 1=slow, 3=default, 11=fast & rough --quality min-max don't save below min, use less colors below max (0-100) --verbose print status messages (synonym: -v) --iebug increase opacity to work around Internet Explorer 6 bug --transbug transparent color will be placed at the end of the palette Quantizes one or more 32-bit RGBA PNGs to 8-bit (or smaller) RGBA-palette PNGs using Floyd-Steinberg diffusion dithering (unless disabled). 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.
node.js - NodeJS child_process:使用spawn和console时的不同结果
我正在尝试使用pngquant
. 这是代码:
image
是一个Buffer
纯PNG数据。该代码有效,但是,由于某种原因,它会生成不正确的 PNG。不仅如此,它的尺寸也比原来的要大。
当我从终端执行此操作时,我得到了出色的输出文件:
我不知道发生了什么;输出文件中的数据看起来很像 PNG。
编辑:我设法使它工作:
我认为这与字符串在 NodeJS 中的表示方式有关。很乐意得到一些解释。