From 6f6f9157c9e0b873f8195dab434bff2be8b0f2d0 Mon Sep 17 00:00:00 2001 From: supine0703 Date: Wed, 7 Aug 2024 05:01:22 +0800 Subject: [PATCH] v1.5.0 --- README.en.md | 44 +++++++++++++++++------- README.md | 56 +++++++++++++++++++++--------- docs/option.example.json | 74 ++++++++++++++++++++++++++++++++++++++++ package-lock.json | 4 +-- 4 files changed, 146 insertions(+), 32 deletions(-) create mode 100644 docs/option.example.json diff --git a/README.en.md b/README.en.md index 0a25e17..3eff546 100644 --- a/README.en.md +++ b/README.en.md @@ -26,13 +26,13 @@ This is a fork of the [picgo-plugin-compress-webp-lossless](https://github.com/ #### Configuration - Compress Type (A detailed comparative analysis table will be made later): - [tinypng](https://tinypng.com/): Damaged compression, need to upload to tinypng. - - [imagemin](https://github.com/imagemin/imagemin): Local lossy compression. - - imagemin-webp: Local lossy compression to webp, support GIF lossy compression. + - [imagemin](https://github.com/imagemin/imagemin): Image compression does not change the suffix, support `jpeg` and `png`. Use [mozjpeg](https://www.npmjs.com/package/imagemin-mozjpeg) and [upng](https://www.npmjs.com/package/imagemin-upng). + - [imagemin-webp](https://www.npmjs.com/package/imagemin-webp): Local compression to webp. Note: Some beds (such as sm.ms) do not support webp image format and will fail to upload. - - [webp-converter](https://www.npmjs.com/package/webp-converter): Local lossy compression to webp, support GIF lossy compression, smaller size, faster. + - [webp-converter](https://www.npmjs.com/package/webp-converter): Same as the last one. - Gif Compress Type: - - webp-converter: Local lossy compresses gif to webp. - - imagemin-gif2webp: + - [webp-converter](https://www.npmjs.com/package/webp-converter): Local lossy compresses gif to webp. + - [imagemin-gif2webp](https://www.npmjs.com/package/imagemin-gif2webp): - Auto Refresh TinyPng Key Across Months: - yes: The TinyPng API Key status is automatically refreshed if it is detected to be across months (different from the last time it was used). - no: No detection, but still record the date. @@ -41,6 +41,11 @@ This is a fork of the [picgo-plugin-compress-webp-lossless](https://github.com/ - Separated by comma(`,`), multiple keys can be used to superimpose the usage times. +##### Compression parameter configuration + +Go to see [option.example.json](./docs/option.example.json) + + # ⚗️ Background @@ -67,7 +72,7 @@ So there is ***`picgo-plugin-compress-next`*** birth 🎉 TinyPng ✅ version >= 2.3.1 - ❌ + 🟡 Highest version 2.3.0 @@ -121,15 +126,15 @@ So there is ***`picgo-plugin-compress-next`*** birth 🎉 - imagemin + imagemin ✅ - mozjpeg:
- Support for local lossy conversion + mozjpeg & upng:
+ Can configure compression parameters - ✅ + 🟡 - mozjpeg:
+ mozjpeg & upng:
Support for local lossy conversion @@ -137,9 +142,9 @@ So there is ***`picgo-plugin-compress-next`*** birth 🎉 ✅ imagemin-webp:
- Supports local lossy conversion to webp + Can configure compression parameters - ✅ + 🟡 imagemin-webp:
Supports local lossy conversion to webp @@ -154,6 +159,12 @@ So there is ***`picgo-plugin-compress-next`*** birth 🎉 ❌ Conversion from gif to webp is not supported + + ✅ + Multiple sets of compression configuration parameters are prepared, and you can configure them yourself + ❌ + Fixed preset parameters + webp-converter ✅ @@ -188,6 +199,13 @@ So there is ***`picgo-plugin-compress-next`*** birth 🎉 - [x] Add ability of `gift 2 webp` - [x] Use `webp-converter`'s `gwebp` - [x] `imagemin-gif2webp` +- [x] Can set compression parameters based on your requirements + - [x] `imagemin-upng` + - [x] `imagemin-mozjpeg` + - [x] `imagemin-webp` + - [x] `imagemin-gif2webp` + - [x] `webp-converter-cwebp` + - [x] `webp-converter-gwebp` # Reporting Issues diff --git a/README.md b/README.md index dbd50fc..3073074 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,13 @@ #### 参数配置 - Compress Type (过段时间会制作详细对比分析表): - [tinypng](https://tinypng.com/): 无损压缩,需要上传到 tinypng - - [imagemin](https://github.com/imagemin/imagemin): 本地有损压缩 - - imagemin-webp: 本地有损压缩为 webp,支持 GIF 格式有损压缩 + - [imagemin](https://github.com/imagemin/imagemin): 图片压缩不改变后缀名,支持 `jpeg` 和 `png`,使用 [mozjpeg](https://www.npmjs.com/package/imagemin-mozjpeg) 和 [upng](https://www.npmjs.com/package/imagemin-upng) + - [imagemin-webp](https://www.npmjs.com/package/imagemin-webp): 本地压缩为 webp 注意:有些图床(比如 sm.ms)不支持 webp 图片格式,会上传失败 - - [webp-converter](https://www.npmjs.com/package/webp-converter): 本地有损压缩为 webp,支持 GIF 格式有损压缩,体积更小,速度更快 + - [webp-converter](https://www.npmjs.com/package/webp-converter): 同上 - Gif Compress Type: - - webp-converter: 本地有损将 gif 压缩为 webp - - imagemin-gif2webp: + - [webp-converter](https://www.npmjs.com/package/webp-converter): 本地有损将 gif 压缩为 webp + - [imagemin-gif2webp](https://www.npmjs.com/package/imagemin-gif2webp): - Auto Refresh TinyPng Key Across Months: - yes: 检测到跨月(与上次使用时年月不同)则自动刷新 TinyPng API Key 的状态 - no: 不检测,但是仍然记录年月 @@ -40,6 +40,9 @@ - 在 [developers](https://tinypng.com/developers) 中申请 - 逗号`,`隔开,可使用多个 Key 叠加使用次数 +##### 压缩参数配置 + +参考 [option.example.json](./docs/option.example.json) # ⚗️ 背景 @@ -67,7 +70,7 @@ TinyPng ✅ version >= 2.3.1 - ❌ + 🟡 最高 version 2.3.0 @@ -121,15 +124,15 @@ - imagemin + imagemin ✅ - mozjpeg:
- 支持本地有损压缩 + mozjpeg & upng:
+ 可以自行配置压缩参数 - ✅ + 🟡 - mozjpeg:
+ mozjpeg & upng:
支持本地有损压缩 @@ -137,9 +140,9 @@ ✅ imagemin-webp:
- 支持本地有损转换为 webp + 可以自行配置压缩参数 - ✅ + 🟡 imagemin-webp:
支持本地有损转换为 webp @@ -149,21 +152,30 @@ ✅ imagemin-gif2webp:
- 支持 gif 本地有损转换为 webp + gif 转换为 webp,可自行配置参数 ❌ 不支持 gif 转 webp + + ✅ + 准备了多套压缩配置参数,可自行配置 + ❌ + 固定的提前设置好的参数 + webp-converter ✅ - jpeg, png, webp 压缩为 webp + + jpeg, png, webp 压缩为 webp
+ 可自行配置参数 + ❌ 不支持使用 webp-converter ✅ - 支持 gif 压缩为 webp + gif 压缩为 webp,可自行配置参数