public class PngCompressor extends Object
It also exposes static helper methods for Java developers to use.
java [options] -jar jdeli.jar compresspng [pngfile [pngfile ...]]
options:
java -jar jdeli.jar compresspng file.png
java -Doverwrite=true -jar jdeli.jar compresspng /directory/*.png
java -Dverbose=true -jar jdeli.jar compresspng /directory/*.png
The output filename is the same as the input name except that _compressed will be appended to the name. E.g. file.png will become file_compressed.png This can be changed to overwrite the existing file by setting the overwrite setting to true.
| 构造器和说明 |
|---|
PngCompressor() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
compress(File input,
File output)
compress 24/32 bit images to 8 bit palette image;
|
static void |
compress(InputStream inputStream,
OutputStream outputStream)
compress 24/32 bit image to 8 bit palette image;
This method does not close the provided OutputStream after the write
operation has completed; it is the responsibility of the caller to close
the stream,
|
static void |
main(String[] args)
For instructions, see main Javadoc for class
|
public static void compress(File input, File output) throws IOException
input - input file or directoryoutput - output directoryIOExceptionpublic static void compress(InputStream inputStream, OutputStream outputStream) throws IOException
This method does not close the provided OutputStream after the write operation has completed; it is the responsibility of the caller to close the stream,
inputStream - PNG file as InputStreamoutputStream - Compressed PNG file as OutputStreamIOExceptionpublic static void main(String[] args)
args - For instructions, see main Javadoc for classIOExceptionCopyright © 2021. All rights reserved.