webpack - 为什么我的图像在 Webpack 中被超压缩?
问题描述
我正在使用带有文件加载器的 image-webpack-loader。尽管我在 pngquant 上使用了“90-100”指数,但我的 png 图像被释放得非常轻且质量很差。目前我的 png_background 有 892 字节!以及上述指标的质量如此差。
这是我的配置:
// images
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: [
'file-loader',
{
loader: 'image-webpack-loader',
options: {
mozjpeg: {
progressive: true,
quality: 65
},
// optipng.enabled: false will disable optipng
optipng: {
enabled: true,
},
pngquant: {
quality: '90-100',
},
gifsicle: {
interlaced: false,
},
// the webp option will enable WEBP
webp: {
quality: 75
}
}
},
],
}
我尝试过使用它一些,但我的图像仍然是超压缩的。我想知道为什么会这样?任何提示都会很棒,谢谢
解决方案
推荐阅读
- python - 如何将数据形状从(A,B)翻转到(B,A)
- javascript - 如何在模式弹出窗口中获取标签的值
- powershell - 如何从 azure 管道克隆 azure repo?
- java - 根据列的值添加火花数据集中的行号
- css - 使用 CSS 的 JavaFX:当其中包含文本时,第一个 TextField 变为黑色
- android - 如何以编程方式更新复选框首选项中复选框的颜色?
- express - 如何解决 SyntaxError:ExpressJS (ejs) 文件编译过程中出现的意外标识符问题?
- python - 熊猫将字符串列转换为布尔值
- javascript - 如何使一行内的所有图像大小相等?
- jquery - 自动幻灯片故障