# compress-img **Repository Path**: xttup/compress-img ## Basic Information - **Project Name**: compress-img - **Description**: node 压缩png 和jpg 图片 的命令行小工具, - **Primary Language**: NodeJS - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-03-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # **node 压缩图片、按缩小图片命令行小工具** ## 暂未放置npm仓库,下载后 键入npm link 使用 *** ## 压缩图片 cprs compress \ [to] [-q|--quality \] from:图片的匹配路径 如 test/**-> test文件夹下的所有jpg和png 图片 to:可选,处理后图片的存放位置, 默认为当前目录/cprs下,如指定/test怎存在在/test/cprs下 -q,--quality \: 可选,指定压缩的质量等级(0-100),默认为50 ``` cprs compress test/* cprs compress test/* /test cprs compress test/* /test -q 10 ``` *** ## 缩小图片 cprs sd \ [to] [-w|--width \] [-h|--height \] from:图片的匹配路径 如 test/**-> test文件夹下的所有jpg和png 图片 to:可选,处理后图片的存放位置, 默认为当前目录/cprs下,如指定/test怎存在在/test/cprs下 -w|--width \: 可选,缩小后宽度值 -h|--height \: 可选,缩小后高度值 #### 等比例缩小至指定宽度 ``` cprs sd test/* -w 200 ``` #### 等比例缩小至指定高度 ``` cprs sd test/* -h 200 ``` #### 缩小至指定高度和宽度 ``` cprs sd test/* -w 200 -h 200 ```