Package com.applitools.utils
Class ImageDeltaCompressor
java.lang.Object
com.applitools.utils.ImageDeltaCompressor
Provides image compression based on delta between consecutive images.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source) Compresses a target image based on a difference from a source image.static byte[]compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source, int blockSize) Compresses a target image based on a difference from a source image.
-
Constructor Details
-
ImageDeltaCompressor
public ImageDeltaCompressor()
-
-
Method Details
-
compressByRawBlocks
public static byte[] compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source, int blockSize) throws IOException Compresses a target image based on a difference from a source image.- Parameters:
target- The image we want to compress. (type is TYPE_4BYTE_ABGR)targetEncoded- The image we want to compress in its png bytes representation.source- The baseline image by which a compression will be performed. (type is TYPE_4BYTE_ABGR)blockSize- How many pixels per block.- Returns:
- The compression result, or the
targetEncodedif the compressed bytes count is greater than the uncompressed bytes count. - Throws:
IOException- If there was a problem reading/writing from/to the streams which are created during the process.
-
compressByRawBlocks
public static byte[] compressByRawBlocks(BufferedImage target, byte[] targetEncoded, BufferedImage source) throws IOException Compresses a target image based on a difference from a source image.blockSizedefaults to 10.- Parameters:
target- The image we want to compress.targetEncoded- The image we want to compress in its png bytes representation.source- The baseline image by which a compression will be performed.- Returns:
- The compression result.
- Throws:
IOException- If there was a problem reading/writing from/to the streams which are created during the process.
-