Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>epoint-image-optimizationNew to Visual Studio Code? Get it now.
epoint-image-optimization

epoint-image-optimization

lonelywarrior

|
1 install
| (0) | Free
使用TinyPNG API压缩项目中的图片,优化网站性能
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

图片优化工具 TinyPNG

这是一个基于 TinyPNG API 的 VS Code 扩展,用于压缩项目中的图片文件,提高网站性能。

功能特点

  • 通过 TinyPNG API 一键压缩项目中的所有图片文件
  • 自动排除 node_modules 等目录
  • 可配置 API Key 和其他设置
  • 提供压缩前后对比统计信息
  • 支持 PNG、JPG、JPEG 和 WebP 格式

使用前提

使用此扩展需要:

  1. 安装 Node.js
  2. 获取 TinyPNG API Key(可免费处理每月 500 张图片)

使用方法

安装扩展后第一次使用

  1. 打开命令面板 (Ctrl+Shift+P 或 Cmd+Shift+P)
  2. 输入并选择 安装TinyPNG命令行工具 命令
  3. 等待安装完成
  4. 通过设置页面配置您的 TinyPNG API Key

配置 API Key

  1. 打开设置 (Ctrl+, 或 Cmd+,)
  2. 搜索 图片优化
  3. 在 TinyPNG API Key 字段中输入您的 API Key

压缩图片

  1. 打开命令面板
  2. 输入并选择 压缩项目图片 命令
  3. 等待压缩完成
  4. 查看优化结果面板

查看压缩统计

  1. 点击活动栏中的图片优化图标
  2. 查看压缩结果统计信息

扩展设置

此扩展提供以下设置:

  • imageOptimization.apiKey: TinyPNG API Key
  • imageOptimization.excludeFolders: 压缩时要排除的文件夹(默认:node_modules, .git, dist, build)
  • imageOptimization.includeExtensions: 要处理的图片文件扩展名(默认:.png, .jpg, .jpeg, .webp)

注意事项

  • TinyPNG 免费账户每月可压缩 500 张图片
  • 压缩操作是不可逆的,建议在版本控制系统保护下使用

问题反馈

如有问题或建议,请在 GitHub 仓库 提交 Issue

更多关于 TinyPNG

访问 TinyPNG 官网 了解更多信息

许可证

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft