# tinify-cli **Repository Path**: mjliuwei_admin_admin/tinify-cli ## Basic Information - **Project Name**: tinify-cli - **Description**: tinify 图片压缩命令行工具 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-11-27 - **Last Updated**: 2023-12-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 使用说明 ## 通过参数 - i, index 切换 tinify 默认提供账号 - k,key 提供自己可用的 tinify 账号 ## 查看默认账号使用情况 ```shell tinity info ``` ## 压缩图片 - 压缩文件夹中所有图片 ```shell tinify zip ./src/assets ./src/assetsCopy ``` - 压缩单文件 ```shell tinify zip ./src/assets/1.png ./src/assets/1_copy.png ``` ## 转换图片大小 ```shell tinify resize ./src/assets/1.png ./src/assets/1_copy.png -m fit -w 200 -h 100 ``` ## 转换图片格式 - 转换文件夹中所有图片 ```shell tinify convert ./src/assets ./src/assetsCopy -t image/webp ``` - 转换单文件 ```shell tinify convert ./src/assets/1.png ./src/assets -t image/jpg image/webp ``` ## 报错说明 - 每个账号免费使用 500 次,当到达使用上限时,可以通过 -i,--index 或 -k,--key 切换账号。 - tinify 不能识别的文件格式,将进行复制操作。 ## 压缩字体 ```shell tinify font ./src/assets/*.ttf ./src/assets --text-file 1.txt ``` 常用中文 1000 字及常用符号 ```shell pyftsubset ./src/assets/1.ttf --text-file="./font/1-1000.txt" --unicodes=U+0020-007E,U+2000-206F,U+3000-303F,U+2160-216F --output-file=1.ttf ``` 常用中文 1001-6763 文字 ```shell pyftsubset ./src/assets/1.ttf --text-file="./font/1001-6763.txt" --output-file=2.ttf ```