提供一个NodeJS环境下,基于TinyPNG服务的,批量压缩任意数量图片的工具。
by AlexQ (email [email protected])
##**工程源码托管在 GitHub ** follow&star
###TinyPNG Smart PNG and JPEG compression Optimize your images with a perfect balance in quality and file size. 如果你想进一步了解TinyPNG压缩图片请移步官网TinyPNG查看。
###什么是TinyPNGNodeJSBatcher? 提供一个NodeJS环境下,基于TinyPNG服务的,批量压缩任意数量图片的工具。
###使用 熟悉tinypng的朋友可以直接进入使用阶段,不熟悉的可以先阅读下面的内容再回头来看这个部分。
demo运行结果(工程中很多图片都已经被压缩过了,所以压缩率demo中不高,你可以用你的工程看一下,效果明显):
###实际场景中的批量压缩 TinyPNG提供了不错的图片压缩,但是免费版本每个月只能免费压缩500张图片,而且我看到产品同学、设计同学往往都是手动的将每一张图片拖动到TinyPNG中,手动的话每次20张图片,这样很不方便,白白耗费人力耗费时间。
###申请TinyPNG的KEY https://tinypng.com/developers/subscription
###解决痛点 我们实际应用中,可能是需要对一个成型的产品里面所有图片文件统一执行压缩,而且图片可能会分散在不同的目录下,那么TinyPNGNodeJSBatcher就是解决这些痛点的。
###简单易用
###浏览接口
###测试 Mac上测试可用
###License
Copyright 2016 AlexQ
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.