PngEncoder - convert a Java Image
to PNG
PngEncoderB - convert a Java BufferedImage
to PNG
Written by J. David Eisenberg (home page)
version 1.5 (see change log)
Purpose
The PngEncoder
class takes a Java Image
as its input and produces a byte array in PNG format. This array can be saved in a file or sent to a client by a servlet.
通过PNGEncoder、JPEGEncoder对bitmapdata进行encode转换为对应图像格式的bytearray,这时会根据对应图像格式的压缩算法转换为编码图像的bytearray,如JPEGEncoder 类使用联合图像专家组 (JPEG) 压缩将原始的位图图像转换为编码图像,PNGEncoder 类使用便携网络图形 (PNG) 无损压缩将原始位图图像转换为编码图像。 https://www.cnblogs.com/frost-yen/p/5367727.html