pngquant-png

 

 

 

 

 

 

png image compression pngquant algorithm Java implementation.

免费的png图片压缩工具

 

Free and open source

Pngquant-png is a free and open source png image compression component, implemented by pngquant algorithm and pure Java

Pure Java

The pure Java language implementation does not rely on other third-party tools

Easy to use

The Pngquant-png component is very simple to use, and can be implemented through stream input and output or directly to the file

 

Usage/使用说明

Maven pom import/引入依赖

<dependency>
   <groupId>com.xqlee.image</groupId>
   <artifactId>pngquant-png</artifactId>
   <version>1.0.0</version>
</dependency>

Java codes/Java伪代码示例

String srcFile="C:\\Users\\xqlee\\Desktop\\test\\swagger_logo.png";
String outFile="C:\\Users\\xqlee\\Desktop\\testout\\swagger_logo.png";
try (FileInputStream fis=new FileInputStream(srcFile);
    FileOutputStream fos=new FileOutputStream(outFile)){
    PngCompressor.compress(fis,fos);
}