Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imgto

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imgto

Image format conversion

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

批量图片转换小工具

NodeJS版本最低 12.20.0,为了更好的体验建议版本14.x

示例

必须进入图片所在的目录执行转换指令

cd src/assets/images # 进入要转换的图片目录
cd src/assets/images/output # 转换后的图片所在目录
默认转换为webp,无压缩,宽高不变
npm i -g imgto # 全局安装
imgto # 执行批量转换
免安装使用:
npx imgto -w 100 -h 50 -t jpeg --fit cover
免安装图片格式转换
npm init imgto png
yarn create imgto png

选项

参数默认值参数类型描述
-w,--width原始宽度Number图片转换后宽度
-h,--height原始高度Number图片转换后高度
-t,--typewebpString转换的图片类型,支持:jpegjpgpngwebpgifjp2tiffavifheifrawtile
-q,--quality100Number图片进行压缩,支持:1-100【100为不压缩】
--fitcoverString裁剪或拉伸时 可选的参数,支持:covercontainfillinsideoutside

压缩

imgto --quality 60 # 执行此指令对图片进行压缩 支持 1-100

格式转换

imgto --type webp # 执行此指令对图片格式进行转换 支持 jpg|jpeg,png,webp

帮助

imgto --help

Keywords

FAQs

Package last updated on 19 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc